Tagged: x
-
AuthorPosts
-
June 17, 2016 at 1:17 pm #1047363
CollaboParticipantHi, I am working on this site for a client http://www.yourherosquest.com/. I like the way that the masonry style looks on the blog page http://www.yourherosquest.com/blog/, however, I would like to add a summary of the article that the post is linking to bellow the image and play button.
I’ve looked through the php files and have been struggling while trying to find where these blog posts are being generated. Can you please help me find where I can add some custom code so that a summary will appear in the bottom, based on the first say, 500 characters or on the post page.
Thanks in advance!
June 17, 2016 at 7:42 pm #1047698
Rue NelModeratorHello There,
Thanks for writing in! What you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file<?php // ============================================================================= // VIEWS/RENEW/CONTENT-AUDIO.PHP // ----------------------------------------------------------------------------- // Audio post output for Renew. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap"> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <div class="entry-thumb"> <?php echo get_the_post_thumbnail( get_the_ID(), 'entry', NULL ); ?> </div> <?php x_featured_audio(); ?> </div> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <?php else : ?> <div class="entry-featured"> <?php x_featured_audio(); ?> </div> <?php endif; ?> <?php if ( is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <?php x_get_view( 'renew', '_content', 'post-footer' ); ?> <?php endif; ?> </div> </article>3] Save the file named as
content-audio.php
4] Upload this file to your server in the child theme’s folder
wp-content/themes/x-child/framework/views/renew/The content excerpt limit can be set in the customizer, Appearance > Customize > Blog > Content and set the “Excerpt Length”.
Hope this helps. Kindly let us know.
June 17, 2016 at 11:26 pm #1048024
CollaboParticipantThank you. It is now showing the full article under the post. I tried setting the excerpt length and saving as you mentioned, but it didn’t make a difference. Should this code be modified?
Thanks.
June 18, 2016 at 12:46 am #1048090
RadModeratorHi there,
From the code above, please change this part of code
<?php if ( is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <?php x_get_view( 'renew', '_content', 'post-footer' ); ?> <?php endif; ?>to this
<?php if ( is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-excerpt' ); ?> <?php x_get_view( 'renew', '_content', 'post-footer' ); ?> <?php endif; ?>Excerpt length is only applicable for excerpts 🙂
Hope this helps.
June 18, 2016 at 3:45 am #1048253
CollaboParticipantI now have the blog page looking proper with the excerpt (http://www.yourherosquest.com/blog/), but it is also showing the excerpt on the individual blog posts and then the content repeats itself (http://www.yourherosquest.com/fd15-in-the-ring-bibianofernandes-mma-one-fc-and-dream-world-champ/).
This is the code:
<?php // ============================================================================= // VIEWS/RENEW/CONTENT-AUDIO.PHP // ----------------------------------------------------------------------------- // Audio post output for Renew. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap"> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <div class="entry-thumb"> <?php echo get_the_post_thumbnail( get_the_ID(), 'entry', NULL ); ?> </div> <?php x_featured_audio(); ?> </div> <?php x_get_view( 'global', '_content', 'the-excerpt' ); ?> <?php else : ?> <div class="entry-featured"> <?php x_featured_audio(); ?> </div> <?php endif; ?> <?php if ( is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <?php x_get_view( 'renew', '_content', 'post-footer' ); ?> <?php endif; ?> </div> </article>June 18, 2016 at 3:51 am #1048255
ChristopherModeratorHi there,
Please update your code to :
<?php // ============================================================================= // VIEWS/RENEW/CONTENT-AUDIO.PHP // ----------------------------------------------------------------------------- // Audio post output for Renew. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap"> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <div class="entry-thumb"> <?php echo get_the_post_thumbnail( get_the_ID(), 'entry', NULL ); ?> </div> <?php x_featured_audio(); ?> </div> <?php if ( ! is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-excerpt' ); ?> <?php endif; ?> <?php else : ?> <div class="entry-featured"> <?php x_featured_audio(); ?> </div> <?php endif; ?> <?php if ( is_single() ) : ?> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <?php x_get_view( 'renew', '_content', 'post-footer' ); ?> <?php endif; ?> </div> </article>Hope it helps.
June 18, 2016 at 11:35 am #1048543
CollaboParticipantPerfect! Thank you.
June 18, 2016 at 10:33 pm #1048910
Rue NelModeratorYou’re welcome!
We’re glad we were able to help you out. -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1047363 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
