function is_page() block current_page_item
-
Hello,
I have a probleme, i would like to create a menu with 3 specific page, number 1,2,3.
First i have this<?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
But if o create more pages, it’s not ok, because there are in the menu.
So, i look the codex and see the parameter “include”, but it’s not ok too.
<?php wp_list_pages('include=1,2,3&depth=1&sort_column=menu_order&title_li='); ?>
Only one page is showed.
I try even with exclude parameter, in adding all new pages, but doesn’t great…
So, i think to put my menu in solid url, but i want keep the parameter css current_page_item, so i do this :
<ul> <?php if ( is_page(propos) ) { ?> <li class="page_item"><a href="<?php echo get_option('home'); ?>/">Home</a></li> <li class="current_page_item"><a href="https://www.mywebsite.com/a-propos/">Préface d’InfoComPub.fr</a></li> <li class="page_item"><a href="https://www.mywebsite.com/definition-de-la-publicite/">Définition de la Publicité</a></li> <li class="page_item"><a href="https://www.mywebsite.com/contact/">Contact</a></li> <?php } else if ( is_page(publicite) ) { ?> <li class="page_item"><a href="<?php echo get_option('home'); ?>/">Home</a></li> <li class="page_item"><a href="https://www.mywebsite.com/a-propos/">Préface d’InfoComPub.fr</a></li> <li class="current_page_item"><a href="https://www.mywebsite.com/definition-de-la-publicite/">Définition de la Publicité</a></li> <li class="page_item"><a href="https://www.mywebsite.com/contact/">Contact</a></li> <?php } else if ( is_page(contact) ) { ?> <li class="page_item"><a href="<?php echo get_option('home'); ?>/">Home</a></li> <li class="page_item"><a href="https://www.mywebsite.com/a-propos/">Préface d’InfoComPub.fr</a></li> <li class="page_item"><a href="https://www.mywebsite.com/definition-de-la-publicite/">Définition de la Publicité</a></li> <li class="current_page_item"><a href="https://www.mywebsite.com/contact/">Contact</a></li> <?php } else { ?> <li class="current_page_item"><a href="<?php echo get_option('home'); ?>/">Home</a></li> <li class="page_item"><a href="https://www.mywebsite.com/a-propos/">Préface d’InfoComPub.fr</a></li> <li class="page_item"><a href="https://www.mywebsite.com/definition-de-la-publicite/">Définition de la Publicité</a></li> <li class="page_item"><a href="https://www.mywebsite.com/contact/">Contact</a></li> <?php } ?> </ul>
But the current_page_item isn’t attributed correctly…
Help me please…
Thanks a lot
- The topic ‘function is_page() block current_page_item’ is closed to new replies.