Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1357368

    Hi,

    I would like change the post layout.
    Put the categories between the text and read more. (attach image)
    Could you help me?

    Thanks Advance,

    BR,

    Antonio.

    #1357393

    Hey Antonio,
    Thank you for the link to your site and the screenshot, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function article_categories_before_read_more() { ?>
      <script>
    (function($){
    $('article.post-entry').each(function() {
    $( this ).find('.blog-categories.minor-meta').insertBefore($(this).find('.read-more-link'));
    });
    })(jQuery);
    </script>
      <?php
    }
    add_action('wp_footer', 'article_categories_before_read_more');

    Best regards,
    Mike

    #1357394

    Hi Mike,

    I have added but it not works.
    Thanks advance

    BR,

    Antonio.

    #1357434

    Hi,
    Thanks for the feedback, I see that you are getting this error: Uncaught ReferenceError: jQuery is not defined typically this means that you are loading jQuery in your footer, try this script instead in your child theme functions.php

    function article_categories_before_read_more() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){
    $('article.post-entry').each(function() {
    $( this ).find('.blog-categories.minor-meta').insertBefore($(this).find('.read-more-link'));
    });
    })(jQuery);
    });
    </script>
      <?php
    }
    add_action('wp_footer', 'article_categories_before_read_more');

    Best regards,
    Mike

    #1357436

    Hi Mike,

    Works perfectly! Many thanks for your help and explanations.
    BR,

    Antonio.

    #1357443

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change post layout’ is closed to new replies.