How to put “Read more” link in Custom Excerpt inside p tag?

One approach is: //… // this is the resulted paragraph without the enclosing <p> and </p> $first_para_inner_text = $matches [1] [1]; // <– the index changed $link = get_permalink($post); // rebuilding the p $first_para=”<p>” . $first_para_inner_text . ‘ <a href=”‘.$link.'”>Read More</a></p>’; echo $first_para; Not tested, but you may get the idea. Just need to modify/change … Read more

Load more posts with multiple queries

Looks like you’re not resetting your query, so WordPress is running a new query on the posts you already got. After your first query add: wp_reset_query(); Always reset after any query that isn’t The Loop. Here’s the codex page on it: http://codex.wordpress.org/Function_Reference/wp_reset_query

Extracting gallery images in WordPress 3.5 on index.php

get_the_content is a template tag and would only work reliably inside a Loop. That means that you should also be able to use the $post global instead. global $post; // may not be necessary unless you have scope issues // for example, this is inside a function $post_content = $post->post_content; preg_match(‘/\[gallery.*ids=.(.*).\]/’, $post_content, $ids); $array_id = … 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

Change behavior of the tag

It sounds like this is a problem with the way your theme is setup, since what you describe isn’t the usual behaviour of the more tag. The first part of your post suggests there’s some built-in Javascript in your theme causing the read more to expand the post text rather than take you to the … Read more