code suddenly appearing from my tempate second loop

Are you absolutely certain that you don’t accidentally have a closing php tag where you shouldn’t? – yes – turned out to be that I had <? rather than <?php – probably the new server was set differently – as per https://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags

Problem when linking out to separate file within foreach loop

As far I’ve known get_template_part() function does not work with foreach loop. So we need to use locate_template() function to this case. This is your customized category template code. Put it there – <?php /** * Category Template: Custom */ get_header(); ?> <div id=”content” class=”site-content container <?php echo codilight_lite_sidebar_position(); ?>”> <div class=”content-inside”> <div id=”primary” class=”content-area”> … Read more

Retrieve tags data in post body

There are two ways to approach this: modify the existing the_tags function or build your own. the_tags ultimately relies on get_the_term_list, which returns a list of hyperlinked tags. You would have to use regular expressions to add classes and styles to that using a filter. That would be quite cumbersome. So, my preferred approach would … Read more