
-
AuthorPosts
-
October 3, 2019 at 8:06 pm #1144609
Blog Posts Element (list layout-excerpt) setting does not show the date to the first or top displayed post excerpt. How can I make the date show like it does for the remaining posts down the page?
October 3, 2019 at 8:19 pm #1144616Hi,
I am getting the error i attached in private content field so i could not view your website. I asked my teammates to check it. Please kindly wait to hear from us.
Best regards,
YigitOctober 4, 2019 at 11:51 pm #1145178Hi,
Thanks for the links, it looks like an error with your plugin “wpfc-minified” Please disable your cache and minifying plugins and also your Enfold Theme Options > Performance > JS & CSS file merging and compression then please clear your browser cache and check.
This can occur when you are using theme caching and minifying plus other caching and minifying.
Please see the screenshots in Private Content area.Best regards,
MikeOctober 7, 2019 at 6:15 pm #1145867I have disabled and deactivated all the above but am still not seeing the date in the first post. Also, we will want our cache and minifying turned back on at some point so…
October 8, 2019 at 4:49 am #1145993Hi,
Thanks for the feedback and disabling your wpfc-minified, this has helped as it now shows you are having a jQuery error. Please check the setting Enfold Theme Options > Performance > Load jQuery in footer, if this is checked please uncheck it.
If this doesn’t help, please include an admin login in the private content area so we can be of more assistance.Best regards,
MikeOctober 8, 2019 at 3:36 pm #1146200It was not checked. So the login information is below.
October 11, 2019 at 5:51 am #1147015Hi,
Sorry for the late reply and thanks for the login, I found that a custom script in your child theme functions.php is causing the error://------------------------- // JS - Meta after title // ------------------------ function metaAfterTitle(){ ?> <script> jQuery(".template-blog .post-entry").each(function(i) { var postTitle = jQuery(this).find('.blog-categories.minor-meta'); var metaInfo = jQuery(this).find('.post-meta-infos'); jQuery(metaInfo).insertAfter(postTitle); }); </script> <?php } add_action('wp_footer', 'metaAfterTitle');
I re-enabled, but please disable and clear your browser cache and check.
Best regards,
MikeNovember 12, 2019 at 9:14 pm #1156160Somewhat related, We now would like to add the publish date meta to the single blog post page. In the Enfold Single Post settings we have display date meta checked but it is not showing on the posts. How do we make sure the date is displayed?
November 13, 2019 at 5:47 pm #1156453Hi,
It looks like you are using the Advanced Layout Builder to create your blog posts, this doesn’t add the post meta.
You can use the shortcode[sc_post_meta]
to add it, after you add this code to the end of your functions.php file in Appearance > Editor:function post_meta_shortcode(){ ob_start(); $taxonomies = get_object_taxonomies(get_post_type($the_id)); $cats = ''; $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id); if(!empty($taxonomies)) { foreach($taxonomies as $taxonomy) { if(!in_array($taxonomy, $excluded_taxonomies)) { $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' '; } } } if(!empty($cats)) { echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." "; echo $cats; echo '</span>'; } echo "<span class='post-meta-infos' style='margin-top: -25px;'>"; $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false)); echo "<time class='date-container minor-meta updated' $markup>".get_the_time(get_option('date_format'))."</time>"; echo "<span class='text-sep text-sep-date'>/</span>"; if ( get_comments_number() != "0" || comments_open() ){ echo "<span class='comment-container minor-meta'>"; comments_popup_link( "0 ".__('Comments','avia_framework'), "1 ".__('Comment' ,'avia_framework'), "% ".__('Comments','avia_framework'),'comments-link', "".__('Comments Disabled','avia_framework')); echo "</span>"; echo "<span class='text-sep text-sep-comment'>/</span>"; } echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." "; echo '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>'; echo '<span class="vcard author"><span class="fn">'; the_author_posts_link(); echo '</span></span>'; echo '</span>'; echo '</span>'; echo '</span>'; return ob_get_clean(); } add_shortcode( 'sc_post_meta', 'post_meta_shortcode' );
some css may be necessary to adjust.
If you are not using the Advanced Layout Builder, you will need to use the blog style Elegant or Default, Modern Business doesn’t show the post meta at the top.Best regards,
MikeNovember 13, 2019 at 5:56 pm #1156456Hi thank you for your resposne. I just added the code to our functions.php file and received an error after clicking save:
Your PHP code changes were rolled back due to an error on line 83 of file wp-content/themes/enfold-child/functions.php. Please fix and try saving again.
syntax error, unexpected ‘=’, expecting ‘)’
DismissIs there an issue with the code on Line 83: $markup = avia_markup_helper(array(‘context’ => ‘entry_time’,’echo’=>false));
November 13, 2019 at 6:21 pm #1156466Hi,
I tested this code on my site before posting it to ensure it still worked, and I looked at your functions.php and tested the shortcode on a post of yours and it worked.
Please check again.Best regards,
MikeNovember 13, 2019 at 6:24 pm #1156468I got it to work. The code via email didn’t work but code from here worked fine.
How do I not display the category and author? I tried removing the code from above with no luck. Do I just need to add a display none to those classes?
Thank you for your help with this!
November 13, 2019 at 7:07 pm #1156474Hi,
You could use css display:none or you could use this function instead:function post_meta_shortcode(){ ob_start(); echo "<span class='post-meta-infos' style='margin-top: -25px;'>"; $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false)); echo "<time class='date-container minor-meta updated' $markup>".get_the_time(get_option('date_format'))."</time>"; echo '</span>'; return ob_get_clean(); } add_shortcode( 'sc_post_meta', 'post_meta_shortcode' );
Best regards,
MikeNovember 13, 2019 at 7:10 pm #1156475Awesome! thank you!
November 13, 2019 at 7:19 pm #1156477Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Blog Posts Element not showing Date meta on first (top) displayed post’ is closed to new replies.