Tagged: post meta, post title
Are there any hooks that will let me move the meta info (date / author) from the below the excerpt to below the title on the single post pages and in the Blog Posts module?
I know I can probably do it by importing the templates into the child theme and hacking them, but then I wouldn’t benefit from future/security updates to those files when the parent theme updates.
Thanks.
Hey RealBasics,
Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
Vinay
Sure. I’ve added the links in the private section.
But basically on the News page each archive item is listed in Title / Excerpt / Meta, and on single pages it’s Title / Full Text / Meta.
In both instances the client wants it to be title, then meta, then content.
Hi,
Thank you for the info. Please add this in the functions.php file:
// custom script
add_action('wp_footer', 'add_custom_script');
function add_custom_script(){
?>
<script>
(function($){
// custom script
function i() {
$('.template-blog article').each(function() {
var meta = $(this).find('.post-meta-infos');
title = $(this).find('.post-title');
$(meta).insertAfter(title);
});
}
i();
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
UPDATE: We modified the code a bit.
Best regards,
Ismael