• Hi there!

    I’m *reasonably* experienced with wordpress, having trouble here though..

    On a brand new blog I’ve built a custom page template, starting with page.php, and it has two columns – one contains all posts from one category, the other contains all posts from a second category. Using two separate loops, this works fine – my problem is that when I go to create the other pages, such as contact and about, I’d like to keep the second column showing posts from a category and have the page content show in the other column – right now it duplicates the page content in each column.

    Here is the working page: https://whiskerspaws.com

    Here is the broken page: https://whiskerspaws.com/contact/

    Please note, the first is correct, the second should look like the first except there should be a contact form in the bottom of the left column.

    Please help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Sounds like the issue is in one of the Loops in your custom template. Try dropping a copy of the file into the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot where it’s going all pear-shaped.

    Thread Starter phobic

    (@phobic)

    The custom template is here:

    https://wordpress.pastebin.ca/1701138

    Again, this should show the contact form on the left, and the posts from one particular category on the right.

    Both of your queries are excluding categories:

    <?php query_posts($query_string . '&cat=-31'); ?>
    <?php query_posts($query_string . '&cat=-32'); ?>
    Thread Starter phobic

    (@phobic)

    Hi, apologies for the delay replying..

    This was because my original plan for laying out content was to show two or more categories in each area – I have switched these around, and the problem still persists.

    worded another way, my problem is this: I have a custom home page showing posts instead of index.php, but my contact page uses a template based on page.php – that page should show the contact page and posts from a certain category on one side of the page – this is not happening, instead the contact form is shown twice.

    Here is the page:

    https://whiskerspaws.com/contact/

    Here is the code:

    https://wordpress.pastebin.ca/1703174

    Many thanks in advance!

    Try replacing <?php query_posts($query_string . '&cat=31'); ?> with <?php query_posts('cat=31'); ?>

    Thread Starter phobic

    (@phobic)

    That works perfectly!

    Many thanks esmi.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘mixing posts and pages’ is closed to new replies.