• Resolved glazebro

    (@glazebro)


    Ok here is my site https://www.stupidpicturesvideosandmusic.com

    I am trying to add a contact page to this site. Through the admin area I have gone to the pages section and added a page with the title “Contact”. It is not showing up on my site tho. Can anyone help me fix this problem? I am pretty new to wordpress by the way so please keep that in mind. I appreciate any help I can get.

    Mike

Viewing 10 replies - 1 through 10 (of 10 total)
  • The template tag, wp_list_pages(), is typically used by theme designers to display Pages in a nav bar. With the help of the Template Hierarchy article, determine what Template is displaying your Pages (probably header.php), then look for wp_list_pages and see if there’s something restricting the Pages that are your menu (e.g an include= or exclude= list).

    Thread Starter glazebro

    (@glazebro)

    Ok here is what I found in the header.php. What do I do with it now? Btw thanks for the help.

      <li<?php if (is_home()) { ?> class=”current_page_item”<?php } ?>>” title=”<?php bloginfo(‘name’); ?>”>Home<?php qbkl_nospace(wp_list_pages(‘include=’.$theme_options[“top_menu_pages”].’&sort_column=menu_order&depth=1&title_li=’)); ?>

    Add the page id of your contact page to the include list. To find the page, go to your page edit and look in the url for ?p=somenumber and enter that number to the list below. For example, if the page id was 20 this would be the code:

    <li<?php if (is_home()) { ?> class="current_page_item"<?php } ?>>" title="<?php bloginfo('name'); ?>">Home
    <?php qbkl_nospace(wp_list_pages('include=20,'.$theme_options["top_menu_pages"].'&sort_column=menu_order&depth=1&title_li=')); ?>

    Hope that works for ya. It’s also including pages liste dint eh “top_menu_pages” in your theme options, so you might be able to include the contact page there instead.

    Thread Starter glazebro

    (@glazebro)

    hmmm I couldn’t get that to work. Here is what I tried.

      <li<?php if (is_home()) { ?> class=”current_page_item”<?php } ?>>” title=”<?php bloginfo(‘name’); ?>”>Home<?php qbkl_nospace(wp_list_pages(‘include=contact,’.$theme_options[“top_menu_pages”].’&sort_column=menu_order&depth=1&title_li=’)); ?>

    I have my permalinks set to /%postname%/

    Thread Starter glazebro

    (@glazebro)

    I also set my permalinks back to default and put the p# in and that did not work for me either.

    Here’s another approach that should work for you, add the link to the contact page in html after the ?>, like this:

    <li<?php if (is_home()) { ?> class="current_page_item"<?php } ?>>" title="<?php bloginfo('name'); ?>">Home
    <?php qbkl_nospace(wp_list_pages('include='.$theme_options["top_menu_pages"].'&sort_column=menu_order&depth=1&title_li=')); ?>
    <li class="page_item"><a href="https://www.stupidpicturesvideosandmusic.com/contact/">Contact</a></li>

    Thread Starter glazebro

    (@glazebro)

    haha success! Thank You! If I want to add more pages can I do the same with a different page?

    I really appreciate your help.

    Thread Starter glazebro

    (@glazebro)

    hmmm there is a little problem though. On all my navigation there is a bar above them. When you are on a particular page that bar should be red. On the contact page it is still gray. Do you know how to fix that by any chance?

    Hi, that red bar shows up when the list item has the “current_page_item” class, so let’s print that if we’re on the contact page. Try this code:

    <li<?php if (is_home()) { ?> class="current_page_item"<?php } ?>>" title="<?php bloginfo('name'); ?>">Home
    <?php qbkl_nospace(wp_list_pages('include='.$theme_options["top_menu_pages"].'&sort_column=menu_order&depth=1&title_li=')); ?>
    <li class="page_item<?php if (is_page('contact')){ ?> current_page_item<?php } ?>"><a href="https://www.stupidpicturesvideosandmusic.com/contact/">Contact</a></li>
    Thread Starter glazebro

    (@glazebro)

    Great I got that to work! Thank You sooo much.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cant add new pages to my navigation’ is closed to new replies.