Tagged: x
-
AuthorPosts
-
April 13, 2016 at 3:12 pm #880768
turnkeydigitalParticipantI am showing the latest two posts on the homepage and I grabbed code to show the excerpt but wanted to change it to using the_content. When doing that the content displays outside of the post above where it should be.
$output .= '<article id="post-' . get_the_ID() . '" class="' . implode( ' ', get_post_class() ) . '">' . '<div class="entry-wrap">' . $image_output . '<div class="x-recent-posts-content">' . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>' . '<span class="x-recent-posts-date">' . get_the_date() . '</span>' . '<span class="x-recent-posts-content">' . the_content() . '</span>' . '<a class="x-btn x-btn-transparent x-btn-square x-btn-regular t' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ) . '">' . 'Read More' . '</a>' . '</div>' . '</div>' . '</article>';April 14, 2016 at 12:17 am #881459
Paul RModeratorHi,
Thanks for writing in!
Please replace the_content() with get_the_content()
Hope that helps.
April 14, 2016 at 8:29 am #882206
turnkeydigitalParticipantThanks that worked.
April 14, 2016 at 4:45 pm #883158
FriechModeratorWe’re delighted to assist you with this.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-880768 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
