Getting index.php instead single.php for displaying posts

Your structures is completely wrong. Remove the template name from your index.php and single.php templates. You only should use those if you create a custom page.php template to let wordpress know it is a custom page. This should apply to your about-page.php, which is also wrongly named, it should be page-about.php. Your index.php looks about … Read more

Auto insert More tags in all posts

If you want to control the string count, then you can do it by the following. Put the below code in the active theme’s functions.php file:– function custom_excerpt_length( $length ) { return 20; // You can change the number here as per your need. } add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 ); By default, excerpt length is … Read more

How To Get Posts With A Specific Word

What you’ve described is just a search for the words “Dolph Ziggler”. You can use WP_Query as such $query = new WP_Query( ‘s=keyword’ ); Note, that you’ll probably want to cache those queries as they’ll be very slow.

Properly display posts on homepage

I think you’re making this far more difficult on yourself than you need to. Easiest Solution First, I’m a bit confused, because the page you call the “blog page” is not actually the blog page. The blog page is the blog posts index page, and the page you’ve linked is actually the category archive index … Read more

Can I use images as anchor tags with

Well, yes, of course. Take a look at this reference: http://codex.wordpress.org/Function_Reference/previous_post_link http://codex.wordpress.org/Function_Reference/next_post_link You can customize it however you like, so you can simply put an html image tag in there. The function must be used in the loop to work. I’d do it like this: <?php previous_post_link(‘%link’, ‘<img src=”https://wordpress.stackexchange.com/questions/141544/Image URL” width=”20″ height=”20″ alt=”%title” />’); ?> … Read more

Display post category in foreach loop with category link

You are fighting with the post globals, like $post, and are not getting them set correctly. Create a proper Loop using WP_Query and use Core template tags where possible and the problem will go away. $authors_posts = new WP_Query( array( ‘author’ => 7, ‘posts_per_page’ => 6, ‘post__not_in’ => array( $post->ID ) ) ); $output=”<ul>”; while … Read more

Adding specific post category between posts in loop

You can use this as a start. This need to go into functions.php. You can use your normal loop in your template files, no need to change anything there. This will add a post from a category after post 3 and 6. Just remember to change the category name with the slug of your category. … Read more

Display featured products by category

First, you have to determine from what category you want to display those products. If this happends on a single post display, you can get all post’s categories via wp_get_object_terms function global $post; $query_args[ ‘category__in’ ] = wp_get_object_terms( $post->ID, ‘category’, array( ‘fields’ => ‘ids’ ) ); If this happens on a archive page, you can … Read more