• Resolved Arteaster

    (@arteaster)


    Hello !

    I want to add “custom footer” above default footer to posts for specific category

    I have function that works, but that “custom footer” also appears on the archive category pages which I don’t want but only on its posts.

    ( I don’t want CSS display: none)

    My function:

    function your_function() { 
    if (in_category(array ('cars' , 'trucks' ))) {
     echo '<p class="plus-footer">Custom content to insert</p>';
     }
    }
    add_action('get_footer', 'your_function');

    Thanks in advance !

    • This topic was modified 2 years, 2 months ago by Arteaster.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add content above footer in posts from specific category’ is closed to new replies.