-
AuthorPosts
-
July 25, 2019 at 12:28 pm #1121887July 26, 2019 at 5:26 am #1122069
Hey apajo,
Could you post a link to where we can see the problem on your actual site please?
Best regards,
RikardJuly 26, 2019 at 12:12 pm #1122138Sure, please see the link below (private content).
FYI, I have checked all check boxes in the settings, but there is no date, no author, etc. on the blog posts.July 29, 2019 at 6:58 am #1122645Hi,
Thank you for the update.
The meta info such as post date or the author will not display automatically when the advance layout builder is activated. You have to switch to the default editor or create a custom shortcode for the post meta info. An example of that can be found in the following thread.
Best regards,
IsmaelAugust 13, 2019 at 12:07 pm #1127164Hi Ismael
Thank you for your reply.
I inserted the code from that thread into my functions.php file and inserted the short codes [sc_post_title] / [sc_author_name] into a post. However, all I get is the short codes shown in the post. Does the code still work, or did I miss a crucial step?August 18, 2019 at 1:09 am #1128560Hi,
Sorry for the late reply, Please include an admin login in the Private Content area so we can investigate.Best regards,
MikeAugust 24, 2019 at 3:32 pm #1130612This reply has been marked as private.August 24, 2019 at 5:31 pm #1130626Hi,
Thank you for the login, Here is how to add the post meta to an Advanced Layout Builder post via shortcode like this:
First add this function to your functions.php:function post_meta_shortcode(){ ob_start(); echo "<span class='post-meta-infos'>"; $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>"; } $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><span class="text-sep text-sep-cat">/</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' );
Then add this shortcode into a code block element and add the custom class “meta-shortcode” to the code block element:
[sc_post_meta]
Then add this css into your Enfold Theme Options > General Styling > Quick CSS field:#top.single-post .post-entry .meta-shortcode .blog-categories { display: inline-block !important; top: 0 !important; }
I have added this to your site for the post in the Private Content area and it is working, please review.
Best regards,
MikeAugust 26, 2019 at 6:12 am #1130859Thank you very much for your help, it’s working now!
I have some follow-up questions:1. How can I change the font size of this short-code content? I tried adding it in the CSS but no effect.
2. Comments are not shown in the short code. I used to have a “disable comments” plugin but it is dis-activated. Nevertheless, comments are not shown below the posts, nor in the short code.
3. When I click on the author link, it leads me to a page (author page) where there is a small mistake in the code (see screenshot link in private content).August 26, 2019 at 4:57 pm #1131028Also, how can I get it to show “Last updated: March 20, 2019” (last modified date) instead of just the posting date?
August 27, 2019 at 10:15 pm #1131472Hi,
Here https://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/
you can check the How to do itBest regards,
BasilisAugust 28, 2019 at 9:15 am #1131512Thank you, I will look into it.
Could you also check the questions before my last post? Thanks!August 30, 2019 at 3:54 am #1132149Hi,
Sorry for the late reply, to change the font size of the shortcode output please use this css:.container .post-meta-infos .minor-meta { font-size: 1.1em !important; }
The default size is “.9em” so adjust to suit.
For the comments in the meta shortcode, it should show once you add the comments element, since you are building your post with the Advanced Layout Builder you will need to manually create it. I have tested on my localhost and the comments show in the meta field.
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.