• Resolved q8ieng

    (@q8ieng)


    Dear mates,

    Kindly how can I add the home link to the list of pages?
    here is the link to my blog
    https://www.worldofbean.com

    and here is the code i’m trying to modify, the original code:
    <?php wp_list_pages('show_home=1&title_li=<h2>Pages</h2>' ); ?>

    After I did modification, it didn’t work, this is what I did!
    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>

    Note that I can’t use “wp_list_menu” since it is not used by my theme!

    Thanks for the further assistance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Your Home page is not a static page, so you can’t add it via wp_list_pages. You’ll need to add the code manually.

    Thread Starter q8ieng

    (@q8ieng)

    Can you help kindly?

    Try changing:

    <li class="pagenav"><?php wp_list_pages('show_home=1&title_li=<h2>Pages</h2>' ); ?>

    to:

    <li class="pagenav"><h2>Pages</h2>
    <ul>
    <li<?php if( is_home() || is_front_page() ) echo ' class="current_page_item';?>><a href="<?php bloginfo('url');?>">Home</a></li>
    <?php wp_list_pages('title_li=');><
    </ul></li>
    Thread Starter q8ieng

    (@q8ieng)

    I got this error

    Parse error: syntax error, unexpected ‘>’ in

    Sorry – typo. Try:

    <li class="pagenav"><h2>Pages</h2>
    <ul>
    <li<?php if( is_home() || is_front_page() ) echo ' class="current_page_item';?>><a href="<?php bloginfo('url');?>">Home</a></li>
    <?php wp_list_pages('title_li=');?>
    </ul></li>
    Thread Starter q8ieng

    (@q8ieng)

    WOW! It appeared “Home” but it has no link! only text

    Thread Starter q8ieng

    (@q8ieng)

    No it is ok, i figured out that in the main page it shows “text” but when you head to other page, “home” changes to “link”.

    Thanks a lot, much appreciated my friend ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How can I add the home link to my pages?’ is closed to new replies.