I know I can add some codes using:- is_front_page
But, I want to add different codes into footer of different post types. Then what can I use instead of is_front_page
You can use is_singular()
instead.
According to Codex, you can use this function the following way:
is_singular($post_type);
Then you can print your desired code into footer the following way:
function my_footer_code() {
if ( is_singular('my-post-type') ){
//Your code here
}
}
add_action('wp_footer','my_footer_code');