Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #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?

    #1144616

    Hi,

    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,
    Yigit

    #1145178

    Hi,
    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,
    Mike

    #1145867

    I 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…

    #1145993

    Hi,
    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,
    Mike

    #1146200

    It was not checked. So the login information is below.

    #1147015

    Hi,
    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,
    Mike

    #1156160

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

    #1156453

    Hi,
    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,
    Mike

    #1156456

    Hi 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 ‘)’
    Dismiss

    Is there an issue with the code on Line 83: $markup = avia_markup_helper(array(‘context’ => ‘entry_time’,’echo’=>false));

    #1156466

    Hi,
    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,
    Mike

    #1156468

    I 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!

    #1156474

    Hi,
    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,
    Mike

    #1156475

    Awesome! thank you!

    #1156477

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

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Blog Posts Element not showing Date meta on first (top) displayed post’ is closed to new replies.