Tagged: Blog, category, grid, meta info, postslider
Hi,
I use the ALB element for showing posts in a grid, I guess the corresponding file is postslider.php.
I use this snippet from @Ismael to show the categories:
How can I switch the post title with the category?
My PHP is not so good that I could change this in the file for myself.
Thanks for helping me out.
Hey Gitte,
Thank you for using Enfold.
You can use this script to move the categories before the post title..
add_action('wp_footer', 'ava_custom_script_move_blog_info');
function ava_custom_script_move_blog_info(){
?>
<script type="text/javascript">
(function() {
const posts = document.querySelectorAll('.slide-entry');
if( posts ) {
posts.forEach( post => {
const cat = post.querySelector('.blog-categories');
const title = post.querySelector('.slide-entry-title');
cat.parentNode.insertBefore(title, cat.nextSibling);
});
}
})();
</script>
<?php
}
Best regards,
Ismael
it works perfectly, thanks for your help, appreciate it very much, Ismael.
Hi Gitte,
Glad Ismael could help.
If you need further assistance please let us know.
Best regards,
Victoria