Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2012, 04:34 PM   PM User | #1
andersedvardsen
New Coder

 
Join Date: Oct 2011
Location: Norway
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
andersedvardsen is an unknown quantity at this point
Wordpress, editing page content in sections

Hello!

I am building a site for my company. I would like to use wordpress to "force myself" to learn even more about the possibillities it offers.

My layout is based on boxes that have 30px margin on every side. Some boxes contain text, some contain images, some contains forms. The problem i am having is that i cannot divide a wordpress page into editable boxes. If i for example create the page "Services" and i want to be able to write some text in 7 different boxes vertically, with aligning boxes with images horizontally to every text box, i am not able to do it. The only option i have is to write a bunch of text in the one content feild i am provided with on a wordpress page.

Here is what i want it to look like:

http://www.andersedvardsen.no/sharin...on_example.png

What would be the best way to go about this to have an effective wordpress installation?

thanks in advance, Anders
andersedvardsen is offline   Reply With Quote
Old 03-18-2012, 10:54 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Create a "New Page" for each of those 7 boxes.
Type in each one and publish the pages, each with
their own titles and content.

When you are in admin click on view all pages and scroll
your mouse over the titles. Look at the status bar on the
bottom of your browser to see the URL ... post.php?post=123&action=edit

Write down the post number for each of the 7 pages.

Now, go into the admin part "Appearance, editor" and open the theme
file called "main index template" or whatever your theme calls it.

You can specify on your index template exactly which page to display for
each <div> section ... or each of those 7 boxes.

This is an example, but of course it's not your theme, so yours won't look the same.
I'm showing this to let you see how you can specify the page "post number", that
you wrote down earlier.

In my example, I'm only displaying page 44 in my "feature" box ...

PHP Code:

 <div class="feature">
        <?php $recent = new WP_Query("page_id=44"); while($recent->have_posts()) : $recent->the_post();?>
        <div class="feat">
<?php the_title(); ?>
</div>
          <?php the_content(); ?>
         <div class="clr"></div>
<?php endwhile; ?>
      </div>


.

Last edited by mlseim; 03-18-2012 at 10:56 PM..
mlseim is offline   Reply With Quote
Old 03-24-2012, 01:15 PM   PM User | #3
andersedvardsen
New Coder

 
Join Date: Oct 2011
Location: Norway
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
andersedvardsen is an unknown quantity at this point
Thanks for answering. The solution you are presenting is working :-)

Although i would like some help to make it even better. i want all the box-pairs (text box to the left, image box to the right) to be displayed based on its category. I am going to use this solution for a portofolio with webdesign, graphic design, movies and photos. So i would like the visitor to be able to sort what appears on the portofolio site with some categories at the top.

Could i make a new page (or preferably a new post) per box-pair, set its category to "wedding photo", insert a feature image wich will be the image in the right box and then include all the boxes that matches the criteria the visitor chooses at the top.

I have tried several soultions i have gotten by browsing the WP Codex and the forums there, but none seem to work.

Any ideas?
andersedvardsen is offline   Reply With Quote
Reply

Bookmarks

Tags
boxes, page, sections, wordpress

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:17 PM.


Advertisement
Log in to turn off these ads.