wp_dropdown_nav function to list menu items
wp_dropdown_nav function to list menu items
wp_dropdown_nav function to list menu items
To create the menu in the first place, feel free to use the shortcode [AVIA_tree_menu root=”your_root_document_title”] by adding this to functions.php: function sc_AVIA_tree_menu($atts) { extract(shortcode_atts(array(‘root’ => ‘Start’,), $atts)); //default if empty. $page = get_page_by_title($root); $args = array( ‘child_of’ => $page->ID, ‘date_format’ => get_option(‘date_format’), ‘depth’ => 0, ‘echo’ => 0, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, … Read more
How to display the FAQ Archive page in my menu
As pointed out from @Howdy_McGee it should be possible to use the current-menu-anchestor css class. However, using the standard menu walker in a CPT archive page taxonomically nested under a menu item I wasn’t able to get the class out as expected. The solution I adopted was to add a create a filter to inject … Read more
Don’t use a function for the callback, use a class. Something like this: class Competition_Manager_Page { private $extra; public function set_extra( $value ) { $this->extra = $value; } public function render() { // show you page content, then: print $this->extra; } } You can extend the class’ functionality later. Now, when you register the menu, … Read more
Conditions for single post
Do not know if it’s exactly what you’re looking for but this short snippet adds custom classes to nav menu item : add_filter(‘nav_menu_css_class’ , ‘wpse_143574_nav_class’ , 10 , 2); function wpse_143574_nav_class($classes, $item){ $classes[] = “my-class”; } return $classes; } This could be modified with some conditional tags too. EDIT: $item is often useful for example … Read more
After some additional research it looks like it will require to use two separate methods to get next/previous page/post to work. More here,here and here Solution for pages: <?php $pagelist = get_pages(‘sort_column=menu_order&sort_order=asc’); $pages = array(); foreach ($pagelist as $page) { $pages[] += $page->ID; } $current = array_search(get_the_ID(), $pages); $prevID = $pages[$current-1]; $nextID = $pages[$current+1]; ?> … Read more
Whenever you would use a class method within add_action function, then within the array parameter, you have to pass an instance of that class as the first value and then you the method name as the second value of the array. In your code, you did not pass any instance actually. And that’s why it … Read more
You’ve got a static height set on a block-level element: style.css:806 /** * 4.1 Site Header * —————————————————————————- */ .site-header { position: relative; background: url(http://barkleyphoto.com/_wedding/wp-content/uploads/2014/05/cropped-header-background.jpg) no-repeat scroll top); height: 100px; } remove the height: 100px; and it should work like you expect.