Forums

[resolved] display specific pages (3 posts)

  1. sagive
    Member
    Posted 1 year ago #

    I need to display specific pages = plz HELP

    i know how to display specific pages using:
    <?php wp_list_pages('title_li=&include=0,1,2,3,30,105,97,52'); ?>

    But my template uses some weird code to maintain its apearnce:

    <li<?php if ( is_front_page() ) echo ' class="current_page_item"'; ?>><a href="<?php echo get_option('home'); ?>/"><span>דף הבית</span></a></li>
    <?php $pages = wp_list_pages('sort_column=menu_order&title_li=&echo=0');
    $pages = preg_replace('%<a ([^>]+)>%U','<a $1><span>', $pages);
    $pages = str_replace('</a>','</span></a>', $pages);
    echo $pages; ?>

    So what ever i do influences the appearance badly..
    Anyway to show spcific pages without messin up this code ???

    would appreciate any help plz

  2. vtxyzzy
    Member
    Posted 1 year ago #

    From what I can see, the replaces are just putting a span tag around the displayed text for the link (which AFAIK is technically not correct). You should be able to just add the include argument like this:

    <?php $pages = wp_list_pages('sort_column=menu_order&title_li=&echo=0&include=0,1,2,3,30,105,97,52');

  3. sagive
    Member
    Posted 1 year ago #

    geez, how didnt i try that

    Thanks a lot vtxyzzy... very helpful :)

Topic Closed

This topic has been closed to new replies.

About this Topic