-
AuthorPosts
-
July 6, 2022 at 9:33 am #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.
July 6, 2022 at 1:33 pm #1357393Hey 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,
MikeJuly 6, 2022 at 1:43 pm #1357394Hi Mike,
I have added but it not works.
Thanks advanceBR,
Antonio.
July 6, 2022 at 6:52 pm #1357434Hi,
Thanks for the feedback, I see that you are getting this error:Uncaught ReferenceError: jQuery is not definedtypically this means that you are loading jQuery in your footer, try this script instead in your child theme functions.phpfunction 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,
MikeJuly 6, 2022 at 6:56 pm #1357436Hi Mike,
Works perfectly! Many thanks for your help and explanations.
BR,Antonio.
July 6, 2022 at 7:21 pm #1357443Hi,
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 -
AuthorPosts
- The topic ‘Change post layout’ is closed to new replies.
