Current state:
<div class="menu">
<div class="menuborder">
<ul class="menubar">
<li class="page_item page-item-9 current_page_item"><a href="https://localhost:8080/izzywp/test2/">HOME</a></li>
</ul>
</div>
</div>
What i want to make :
<div class="menu">
<div class="menuborder">
<ul class="menubar">
<a href="https://localhost:8080/izzywp/test2/"><li class="page_item page-item-9 current_page_item">HOME</li></a>
</ul>
</div>
</div>
I list the items with this code :
<?php wp_list_pages( array( ‘title_li’ => ” ) ); ?>
]]>https://www.ads-software.com/plugins/wpb-accordion-menu-or-category/
]]><?php
if($post->post_parent) {
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
$titlenamer = get_the_title($post->post_parent);
}
else {
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
$titlenamer = get_the_title($post->ID);
}
if ($children) { ?>
<h2> <?php echo $titlenamer; ?> </h2>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>
]]>I’m using this code to display my pages
<?php $args = array(
'sort_column' => 'menu_order',
'title_li' => '',
'depth' => '1',
'echo' => 0
);
$separator = '<img src="https://localhost/test_theme/images/nav-divide.png"';
$pattern = '/(<\\/a>).*?(<\\/li>).*?(<li)/is';
$replace = '</a>' . $separator . '</li><li';
$subnav = preg_replace($pattern,$replace,wp_list_pages($args));
echo $subnav; ?>
This work well, however I have the problem that I want to exclude the holding page from the list.
I usually use this code to remove a page
<?php $page1 = get_page_by_title ('Holding'); wp_list_pages('exclude='. $page1->ID . '&title_li='); ?>
but can’t use this because it doesn’t include the seperators, does anyone know how I can alter the code with the seperators to exclude the page with the title ‘Holding’?
I have looked at the ‘exclude’ => ”, but would like to exclude by title rather than by number.
Thanks in advance
Mark
I’ve got a question about wp_nav. Now I’ve got 2 menus in my theme. And i made them with wp_nav and that works well.
But I also want support for WP2 versions. But how can I give support to 2 navigation structures in WP2 as a fallback? Because wp-list-pages throws all navigation items in the output. And I don’t want to edit the code to set hardcoded page-id’s but it must be editable in the backend.
Anyone that can help me out?
]]>I am desperately trying to create a drop down navigation bar. I’ve had no problem with wp_list_pages so far but decided on a dropdown hover state for the child pages.
Is this possible and how?? Help greatly appreciated.
Thanks.
]]>wp_list_pages()
However, whenever I use it, it seems to just make a bulleted list. Is there any way I can use it to list all of my pages, add a hyphen, then list the pages description, not in a bulleted list? So for example…
Page 1 – This is page 1’s description
Page 2 – This is page 2’s description
Page 3 – This is page 3’s description
]]>I want to give the user the ability to edit which pages appear in the menu using the wp_list_pages template tag. For example I have a box for them to type something like “exclude=1,17,12” and then be placed inside the template tag as an $args.
For all the other items in the Theme Options page, I add this to the template to get the results:
<?php $office_hours = get_option('laketext_office_hours'); echo stripslashes($office_hours); ?>
What do I need to type into wp_list_pages() to allow the ID: _page_navigation to appear correctly?
]]>I backed up the database and restored it on the new server, zipped the httpdocs folder from the subdomain and unzipped it into the new domains httpdocs directory. I restored the database to a new database name. I then updated the wp-config file with the new username, password, and database name. Next I updated options_value’s in wp_options replacing the old domain with the new domain. (I have done this many times with other sites and this is all I ever had to do in previous version of wordpress).
The site does display, but anywhere I have used the bloginfo function in my php it is still pulling the old subdomain address for ‘stylesheet-directory’, ‘stylesheet-url’, and ‘home’ values passed to that function. Also wp-list-pages is pulling with links to the old subdomain url.
I did some research and updated my wp-config file to contain:
define(‘WP_HOME’,’https://mynewdomain.com’);
define(‘WP_SITEURL’,’https://mynewdomain.com’);
this didn’t seem to change anything.
I need to get this working, what did I miss?
]]>