the-events-calendar, pagination with tribe_get_events()

Set the offset manually. $offset = ( get_query_var( ‘page’ ) ) ? get_query_var( ‘page’ ) : my_parse_url_for_offset(); function my_parse_url_for_offset() { if( strpos( $_SERVER[‘REQUEST_URI’], ‘/page/’ ) !== false ) { $url = explode( “https://wordpress.stackexchange.com/”, $_SERVER[‘REQUEST_URI’] ); $url_c = count( $url ); for( $i = 0; $i < $url_c; $i++ ) { if( $url[$i] == ‘page’ ) … Read more

Next/Previous links doesn’t work in the same category

This is the default in WordPress Twenty Eleven Theme <nav id=”nav-single”> <h3 class=”assistive-text”><?php _e( ‘Post navigation’, ‘twentyeleven’ ); ?></h3> <span class=”nav-previous”><?php previous_post_link( ‘%link’, __( ‘<span class=”meta-nav”>&larr;</span> Previous’, ‘twentyeleven’ ) ); ?></span> <span class=”nav-next”><?php next_post_link( ‘%link’, __( ‘Next <span class=”meta-nav”>&rarr;</span>’, ‘twentyeleven’ ) ); ?></span> </nav><!– #nav-single –> I copy pasted your code to replace the above … Read more

Listing Sub-Pages & Sub-Sub-Pages

So it turns out to be a bit easier than I thought: <?php if ($post->post_parent) { $ancestors=get_post_ancestors($post->ID); $root=count($ancestors)-1; $parent = $ancestors[$root]; } else { $parent = $post->ID; } ?> <?php $args = array( ‘depth’ => 0, ‘date_format’ => get_option(‘date_format’), ‘child_of’ => $parent, ‘title_li’ => __(”), ‘sort_column’ => ‘menu_order, post_title’ ); ?> <ul> <?php wp_list_pages( $args … Read more

Possible to hide Page if no posts from a CPT?

So I’ve come up with a solution – although I am not sure if this is the best, as it outputs CSS, something I prefer not to do. In the header.php of the theme: <?php $published_posts = wp_count_posts(‘CPT1’)->publish; if ( $published_posts == 0 ): echo ‘<style>.page-item-8{display:none;}</style>’; endif ?> <?php $published_posts = wp_count_posts(‘CPT2’)->publish; if ( $published_posts … Read more

New Page Position

To add a custom hash to the end of each URL added through the menu backend is easier said than done. You could build a custom walker. Or you could try to hook in the walker_nav_menu_start_el filter and edit just that, perhaps like so[nav-menu-template.php]: add_filter( ‘walker_nav_menu_start_el’, ‘my_skip_to_nav’, 10, 4 ); function my_skip_to_nav( $item_output, $item, $depth, … Read more

Add ID to target navigation link

I wasn’t able to find something that would add an id, but I did find something that would give me a class…this way I can target the class using jQuery. The default id’s and classes are ok, but the solution I found is much better because no matter which website you apply it to it … Read more

Setting Up “Split Site” Navigation in WordPress

You can use categories with pages, via register_taxonomy_for_object_type, but if you were to use a taxonomy for this, it may be better to register a custom taxonomy specifically for that purpose. Another option is to add a meta box and provide simple means of selecting a menu, which would be saved and accessed via post … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)