Hot answers tagged navigation
2
The code in question is in header.php, line 45.
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
This is the Codex reference to this function: wp_nav_menu.
From my experience, and some googling, this previous answer has the answer you're looking for.
If possible, would just adding a class to the ...
2
Use ancestors:
$ancestors = array_reverse( get_post_ancestors( $post->ID ) ); // reverse ancestors to make it more intuitive
if ( isset( $ancestors[0] ) ) {
if ( isset( $ancestors[1] ) ) {
// 3rd tier
$parent_id = $post->post_parent;
} else {
// 2nd tier
$parent_id = $post->ID;
}
$args = array(
...
2
Check out get_next_post_sort and get_previous_post_sort filters. You can modify the ORDER BY clause to whatever you want (including ). For example, if you want to sort the 'next post' to be the post with the smallest adjacent post ID:
function wp28041_get_next_post_sort($where){
return 'ORDER BY ID ASC LIMIT 1';
}
add_filter('get_next_post_sort', ...
1
Solved!
The problem was in the plugins settings ...
To fix this problem go to:
Events(Left Admin Sidebar) -> Settings -> Pages -> Event Categories
and set "Override with Formats?" to NO
Thats it ... I hope this information to be useful for others, and save them a lot of time, which they coud use for a walk, drinking beer and whatever they want. ;)
Cheers!
1
For previous and next post links to work, you need to hook on to the get_*_post_* filters and modify the query to actually sort the posts using your custom field. I hope the code below will work for you.
For Previous post link
add_filter('get_previous_post_join', 'wpse96670_get_previous_post_join_custom_sort');
add_filter('get_previous_post_where', ...
1
This is my Solution, I used Onclick attributes for the radio buttons to change the 'actions' of elements within the form.
<form id="searchme" action="<?php echo site_url(); ?>/postersearch" method="get">
<ul class=" four columns inline-list offset-by-one">
<li><label for="radio4"><input name="post_type" CHECKED ...
1
Hook into 'template_include' and change the template here.
Made up example, not tested:
add_action( 'template_include', 'wpse_96472_search_template' );
function wpse_96472_search_template( $template )
{
if ( ! is_search() )
return $template;
if ( empty ( $_GET['post_type'] ) )
return $template;
if ( 'poster' === ...
1
If you want to return an array of items (not output like wp_nav_menu), you can try this:
$menu_name = 'your_menu_location';
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menu_items = wp_get_nav_menu_items($menu->term_id);
foreach ( ...
Only top voted, non community-wiki answers of a minimum length are eligible
