Hi. I’ve come across a possible ‘issue’ with the excerpt when using PB. Basically, I have a custom loop in a static front page that is pulling specific post excerpts. I think I’ve narrowed it down to the page builder editor that is applied in each post of I have. The excerpt does output on the front page but the ‘read more’ does not link to the post. It just links to root/front page. I’m using the excerpt generation method.
If I remove the page builder editor and use WP’s standard visual/text editor on each post the read more links work on the excerpt. Here is what I have:
front-page.php
array( 1015, 1109, 1340, 1000, 735, 1422));
$query = new WP_Query( $args ); ?>
have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<a href="”>
<a href="”>
In my functions.php I have:
function new_excerpt_more($more) {
global $post;
return ‘…ID) . ‘”>Read More »‘;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
Whoops Im sorry about the code up top. Hopefully this works. LOL I wish there was a preview. ;)
in my functions.php I have:
Hmm…ok So Im back, I reworked my code on the front page to just use the standard WP loop and added The Post Loop widget on the post. Just a quick observation, it works but for some reason its not pulling in the post thumbnail. Will check back with update. I probably set this up totally wrong.
Ok. So I managed to get this working. Here is what I did, if anyone is interested. Use at your discretion.
So when you use the post loop widget, you have the option to use another template-part of your choice. I made a custom one with different html tags for a dif layout. Thumbnail left and teaser/excerpt right. From within the post loop build query you can select whatever posts you want. Im sure at some point someone will want to break that loop but for now it works.
Though, the readmore filter excerpt is no longer working from the function. It displays (more…) which is something I dont want. I need it to be ‘Read More’ I’ll be back with an update.
front-page.php
content-front-page.php
Ok. So Im thinking I still have a lot to learn about the excerpts within WP. :P All I had to do is change the way i was doing the excerpts. From generated to manual with the more button, which is fine. I swapped out the_excerpt to the_content and added this into the functions.php file and all is good.