How to highlight or show new to the particular posts list

Ok, to display the latest posts you use default Recent Posts widget. You can see it here: Appearance -> Widgets This widget has no settings and is fine for getting started, you can install any plugin which will add a more sophisticated widget to your site, you just need to search for: Recent Posts Widget … Read more

Redirect old Posts URL to new URL

There are lots of solutions to redirect from the old post URL to the new post URL. You can install a plugin “Safe Redirect Manager” and set it from the admin panel. You can write some snippet in the functions.php file as: add_action(‘template_redirect’, ‘post_redirect_by_custom_filters’); function post_redirect_by_custom_filters() { global $post; // this array can contain category … Read more

WordPress rest API get Posts parent by post ID

As posts can’t have parents, there is no endpoint to get the parent ID of a post. However, pages can have parents, so the page endpoint should return a parent ID, among other things. So, by getting mysite.com/wp-json/wp/v2/pages, you should be able to get the parent attribute, which is “The ID for the parent of … Read more

Post template not applying on theme (potentially rendering as Page template)

Fixed it! I have now created a single folder in my theme’s directory and put category specific templates in there. To enable this, I added this to the theme’s function file /* * Define a constant path to our single template folder */ define(SINGLE_PATH, TEMPLATEPATH . ‘/single’); /** * Filter the single_template with our custom … Read more

Find most used words in post titles

Below MYSQL query return the 10 most common value (words) in a post_title(column) FROM wp_posts(table): SELECT post_title, COUNT(post_title) AS Appearances FROM wp_posts GROUP BY post_title ORDER BY Appearances DESC LIMIT 10