previous and next post of same category on singlepost.php

I would not use get_posts() to setup my loop on the single.php page. I would just use the normal proper loop. Please check out this page in the codex about Theme Development Here is an example of a single.php that will work as expected <div id=”primary” class=”content-area”> <div id=”content” class=”site-content” role=”main”> <?php // Start the … Read more

How to filter get previous post function by meta value DESC and post date DESC?

You should just do a new full query for all posts (not just featured ones), and set the orderby to meta_value and just check when doing the loop, if that post meta value is yes, and output the featured template, otherwise output standard one. https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters UPDATE: Maybe something like this: $args = array( ‘posts_per_page’ => … Read more

Previous/Next custom post links within custom taxonomy

I managed to solve this, with some steering in the right direction in the comments under my question, by specifying different templates for different taxonomy terms using single-show.php to divert as follows: if ( have_posts() ) { the_post(); rewind_posts(); } if (has_term(‘current’, ‘show_status’)) { include(TEMPLATEPATH . ‘/single-show-current.php’); } elseif (has_term(‘past’, ‘show_status’)) { include(TEMPLATEPATH . ‘/single-show-past.php’); … Read more

make random internal linking in the middle of posting

You can create a shortcode which can be used anywhere inside a post. The shortcode would be responsible for fetching a random post and displaying it. Example code: <?php /* * Plugin Name: Random Post * Description: Display random post * Version: 1.0 * Author: windyjonas * Author URI: https://www.jonasnordstrom.se */ function display_random_post() { ob_start(); … Read more

how to overwrite next_post_link

You can’t easily change only the URL of that link, because there is no filter that will allow you to do that, but… next_post_link uses get_next_post_link. There are no filters in any of these functions, but… get_next_post_link uses get_adjacent_post_link and inside of that function you can see {$adjacent}_post_link hook. So now we can check docs … Read more

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