current_page_item and custom post type?
You should use wordpress’s built in menu manager for this, along with a specific template file for listing the custom post types (for instance template-literature.php).
You should use wordpress’s built in menu manager for this, along with a specific template file for listing the custom post types (for instance template-literature.php).
For ‘menu_order’ to work, you need to set the page order from the page edit screen. Are you setting orders for your pages?
For now I have decided to use a CSS solution. I realized with the code above I do actually have classes I can work with. For example if you had this navigation in a you could use something like this. nav.sidebar li li li { display: none; } nav.sidebar li li.current_page_item > ul > li, … Read more
I got this to work on a static html page. The problem seems to be the white space in the append. I also removed all the ‘\’ and changed append to use single quotes. Maybe a jQuery expert can enlighten us. (function() { $(‘#mainMenu ul li.page-item-13 a’).append(‘<div id=”megaMenuCopy”><h3>The Range</h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing … Read more
The problem when you set a ‘page’ as the blog roll through the back-end is that it automatically assigns the page as an ‘archive’. In order to solve the problem, I removed this option (ie: set blog roll to –Select–). I set the page to it’s own custom template and made a custom query feed, … Read more
Ok, this code should set you on the right path. It’s not designed to do exactly what you want, but judging by your code above, you seem fairly compitent, so should be able to amend as required. I’d also recommend looking at the Walker_Page Class, that way you can compare the methods below to those … Read more
wp_list_pages does not wrap it’s output in a ul or ol tag. That’s up to you. In other words, if you just call wp_list_pages, it’s going to spit out a bunch of li tags, which your browser assumes is wrong and “corrects” the html as it sees fit. Try this: function widget( $args, $instance ) … Read more
You can use get_page_children function to retrieve all sub pages $the_query = new WP_Query( array( ‘post_type’ => ‘page’, ‘posts_per_page’ => -1 ) ); $children = get_page_children( get_the_ID(), $the_query->query() ); if ( !empty( $children ) ) { foreach ( $children as $child ) { // render menu } }
According to this thread, you can add a custom Walker class to your wp_list_pages() call. It looks like that’s the way to go, since wp_list_pages() prints or returns a string. If you set $args[‘echo’] to false, you can do some string manipulation before you echo() it, but it seems to me that the Walker solution … Read more
Try using the widget “custom menu” in the widgets. Create a custom menu with the pages you need and give that menu to this widget.