Exclude read more in the_excerpt [closed]
I asked to author theme. It was by filter from functions.php
I asked to author theme. It was by filter from functions.php
WP Bakery Load More Button loads the same posts
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
review this codex and see if the info in it can help: http://codex.wordpress.org/Customizing_the_Read_More
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
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
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
Take a look at this article in the WP-Codex: http://codex.wordpress.org/Customizing_the_Read_More Al you need is explained there. To style the read more link you need to know basic css.
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
Remove the read more with this code in your functions.php: function wpse_230169_excerpt_more($more) { return ”; } add_filter(‘excerpt_more’, ‘wpse_230169_excerpt_more’); Then in your template file just add the link wherever you want with: <a href=”https://wordpress.stackexchange.com/questions/230169/<?php the_permalink(); ?>”>Read More</a>