Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1121887

    I have tried checking/unchecking the boxes in this setting page but it doesn’t seem to have any effect. For instance, I’d liketo show author info below each post/page, but the settings are not doing anything:
    Image 2017-11-06 at 16.03.29.png

    #1122069

    Hey apajo,

    Could you post a link to where we can see the problem on your actual site please?

    Best regards,
    Rikard

    #1122138

    Sure, 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.

    #1122645

    Hi,

    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.

    // https://kriesi.at/support/topic/post-using-advanced-editor-how-to-insert-post-meta-info-title-date-etc/#post-466158

    Best regards,
    Ismael

    #1127164

    Hi 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?

    #1128560

    Hi,
    Sorry for the late reply, Please include an admin login in the Private Content area so we can investigate.

    Best regards,
    Mike

    #1130612
    This reply has been marked as private.
    #1130626

    Hi,
    Thank you for the login, Here is how to add the post meta to an Advanced Layout Builder post via shortcode like this:
    2019-08-24-110340
    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]

    2019-08-24-111625
    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,
    Mike

    #1130859

    Thank 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).

    #1131028

    Also, how can I get it to show “Last updated: March 20, 2019” (last modified date) instead of just the posting date?

    #1131472
    #1131512

    Thank you, I will look into it.
    Could you also check the questions before my last post? Thanks!

    #1132149

    Hi,
    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.
    2019-08-29-215158

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.