Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Separate template logic from template functions.php

$
0
0

Replies: 0

As written in the WordPress Codex, template/design should be separated from program logic.

Actually there are template parts hardcoded in functions.php:

if ( ! function_exists( 'fruitful_entry_meta' ) ) {
function fruitful_entry_meta() {
?>
	<span class="author-link author"><a href="<?php print esc_url( get_author_posts_url( get_the_author_meta( 'ID' ))); ?>"><?php print get_the_author(); ?></a></span>

Typically this should be separated.
For example in an include file.

Otherwise if somebody wants to remove the author link from any post, he has to remove this function…


Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>