• Resolved eatanicecream

    (@eatanicecream)


    I’m using WordPress as a CMS and building a site at http://www.educationforallke.org/wordpress

    On my home page (but only on the homepage), the page title appears twice. I’ve looked all over for the bit of PHP code that presumably does it, but I can’t find it.

    Also, anyone know how to have a different page title on the page to what is shown in the navigation menu?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It’s difficult without seeing the original code – you can paste index.php here

    http://wordpress.pastebin.ca

    Takes about 10 seconds, don’t need to register or anything.

    Also: some of your </divs> are missing, apparently, if you use Firefox and the HTML validator to look at the markup.

    Presumably you’re using category links for the navigation? If you set up individual category templates e.g. category-2.php you can put what you want in as the header.

    Better still, use child_of e.g.
    <?php wp_list_categories('child_of=3&title_li=&orderby=id&order=asc'); ?>

    This way you create a parent category called sidebar navigation, then only show the child categories of it, so that you can add and subtract child categories at will without making sitewide changes in all categories

    If one of your child categories (e.g. Achievements) had an ID of 6, then you would create category-6.php and in the top of it put your own header e.g. What we’ve achieved so far

    Thread Starter eatanicecream

    (@eatanicecream)

    Thanks for replying and for the pointers.

    I don’t really know more than the basics of PHP so I have been modifying an existing theme.

    The pastebin link for the main index template is http://wordpress.pastebin.ca/936751

    The php code that generates the navigation is <?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'.$pages_to_exclude)?>

    Can I just replace it with the category links code?

    Ah – not categories, pages. Same principle if you want to use child pages:

    Links to child Pages (sub-pages) ONLY of a Page with an ID of 2 can be shown by using the parameter (‘child_of=2’)

    Child pages (sub Pages) can be created when you write your Page (Admin Panel / Write / Write Page) using the box to the right labelled Page Parent

    So:<?php wp_list_pages('title_li=&child_of=2');?> for example.

    But that said, no- don’t replace anything. Instead, you’ll find a list of all your pages in your admin panel, and presumably one of them is called Objectives.

    Your pages e.g. Objectives etc. can have their own templates. You need to create a template for Objectives, and at the top of it put the header that you want.

    For your Objectives template you need to copy and paste the contents of page.php (hopefully) into something-or-other.php

    Within this new something-or-other.php and towards the top add this:

    <?php /*
    Template Name: OBJECTIVES
    */?>

    When you edit your Objectives Page in Admin Panel / Write / Write page there is a dropdown box from which to select the Page template.

    I see you’ve sorted out the other problem

    Thread Starter eatanicecream

    (@eatanicecream)

    Great, thanks for the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Page title displays twice’ is closed to new replies.