Tagged: x
-
AuthorPosts
-
June 24, 2016 at 2:05 pm #1058405
espyParticipantHey Guys,
I would like to achieve multiple blog archive pages only pulling in specific categories on each page. As of now I only see “recent posts” available to pull in which has a maximum of four posts. Is there a way to achieve this using the theme or custimizing the theme?
I also need the post meta to pull in the author avatar & bio. Any ideas?
URL is http://betternetworkmarketinghabits.io/
-Currently posts are being displayed using a plugin which I would like to getaway from. I want to make recent posts display like the attached image.
June 24, 2016 at 5:43 pm #1058613
JadeModeratorHi there,
Recent posts shortcode is limited to 4 posts only. But you could use it multiple times and by using offset.
[recent_posts count="4" orientation="horizontal"] [recent_posts count="4" orientation="horizontal" offset="4"]This will show 8 posts, from 1 to 4, then 5 to 8.
Hope this helps.
June 24, 2016 at 7:13 pm #1058672
espyParticipantThanks! What file edits the recent posts output? Is there a post teaser archive template?
June 24, 2016 at 10:48 pm #1058933
DarshanaModeratorHi there,
You can extend the recent post functionality by using your child theme. Please check the following example (https://community.theme.co/forums/topic/adding-blog-text-and-read-more-link-to-recent-posts/#post-810125).
Hope that helps.
June 25, 2016 at 8:44 pm #1059686
espyParticipantOk thanks, I’m trying to inject this code
<?php echo get_avatar( get_the_author_meta(‘user_email’), $size = ’75’); ?>In the ouput below but it seems to be having difficulty, I’m not familiar with the syntax on this portion- any advice?
June 26, 2016 at 12:28 am #1059788
Rue NelModeratorHello There,
Thanks for the updates! To inject code, you must not use echo. Please have the code updated and use this instead:
$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>' . do_shortcode('[x_gap size="10px"]') . '<span class="x-recent-posts-excerpt">' . strip_tags(excerpt(6)) . '</span>' . '</div>' . '</div>' .'<div class="authorship-avatar">' . get_avatar( get_the_author_meta('user_email'), $size = '75') .'</div>' . '</article>' . '';Please let us know if this works out for you.
June 27, 2016 at 12:43 pm #1061890
espyParticipantThanks a lot! That did work… There are a couple more areas I need some assistance. This is the working code that I pull in on a single blog post. You got the avatar working, I’m having trouble injecting the category & author name, & date into the teaser as well.
<div class =”author-cmeta”>
<hr>
<div class=”authorship-avatar”>
<?php echo get_avatar( get_the_author_meta(‘user_email’), $size = ’75’); ?>
<div class=”name-cat”>
<?php the_author(); ?>
<br>
<p> in </p>
<div id=’meta-cat’>
<?php $category = get_the_category(); $firstCategory = $category[0]->cat_name; echo $firstCategory;?>
</div>
</div>
</div>
<div id=’the-date-mc’>
<?php echo get_the_date( ‘F d,Y’ ); ?>
<br>
<?php the_time( ‘g:ia’ ); ?>
</div>
<hr>
</div>Thanks!
June 27, 2016 at 6:06 pm #1062312
DarshanaModeratorHi there,
Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer.
For example, you can check the following code on how to get the category and date (https://community.theme.co/forums/topic/recent-posts-can-i-display-date-category/#post-910374)
X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding.
July 5, 2016 at 6:12 pm #1073812
espyParticipantOk no problem thanks!
July 5, 2016 at 11:06 pm #1074145
Prasant RaiModeratorThanks for understanding. Feel free to ask us again. Have a great day! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1058405 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
