Category pagination first link works, remaining don’t
Category pagination first link works, remaining don’t
Category pagination first link works, remaining don’t
get_pages not returning any results or error when get_posts works
next_posts_link and previous_posts_link use the global $wp_query. function get_next_posts_link( $label = null, $max_page = 0 ) { global $paged, $wp_query; http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/link-template.php#L1523 That means you need to do something like this to get those to work correctly. $orig_query = $wp_query; $wp_query = new WP_Query($args); // the rest of your code $wp_query = $orig_query; If you are … Read more
You don’t need to force the permalink structure to do this. These effects are usually handled by adding some class (with a specific style) to the item you want to highlight, in this case the <li> containing the link to the shop. In your site, the Shop menu entry (when in the Shop page) is: … Read more
The following 2 filters allow you to hook into when WordPress checks the slug and are found in the function wp_unique_post_slug() in the wp-includes/post.php file. There are 2 filters, one for hierarchical posts and one for non-hierarchical. The hierarchical filter provides the ID for the post parent so if the $post_parent is 0, you know … Read more
Displaying only posts from a certain category on my custom page template
I’m not entirely certain what you’re asking. If you want to have the list of pages in an ordered list insted of unordered it should be simple: echo ‘<ol>’; wp_list_pages( array( ‘title_li’ => null ) ); echo ‘</ol>’; However if what you’re asking is to order it according to some parameter so that you can … Read more
the_content does echo the content. That is stated in the Codex– “Displays the contents of the current post”, emphasis mine. Use get_the_content instead, to return a string that you can manipulate. Be aware that get_the_content does not run all of the same filter as the_content. Again from the Codex: If you use plugins that filter … Read more
For a hierarchical post type, you can use $post->post_parent and get_permalink(), perhaps like so: <?php global $post; $parent_permalink = get_permalink( $post->post_parent ); ?> <a href=”https://wordpress.stackexchange.com/questions/99483/<?php echo $parent_permalink; ?>”>Parent Post</a>
I’ve solved it with hard coding. I know, it isn’t a great answer, but there was no other choice. Redirecting this plugin wasn’t possible.