How to separate functions from the homepage and posts
-
I have an add_action and function which is global.
Written by ‘. get_the_author() .’ ?? · ? ‘. get_comments_number() .’ ·? ‘. get_the_date(‘jS F Y’) .’
How do you make it look like this, only inside a post, and not on the homepage:
Written by ‘. get_the_author() .’ · ?? ‘. get_the_date(‘jS F Y’) .’ ?· [number] minutes read? </span>’;
I can see 2 steps to get the desired results:
1. A function to hide the function [‘. get_comments_number() .’] in posts only
2. A function that makes the add_action & function only visible to the homepage, so we can create a new add_action & function only visible in specific posts
Because I also want to be able to modify the [number] minutes read in every post, if that is possible with functions?
- The topic ‘How to separate functions from the homepage and posts’ is closed to new replies.