• Hello.

    Can you help me please to hide post META from Tag archives?

    I dont need footer like “Published 14.08.2023 in Software with tags Android”

    I tried hook:

    function remove_post_meta() {
    	if (is_tag()) {	
    	remove_action( 'entry_footer', 'twentytwelve_entry_meta' );		
    }}
    add_action ( 'entry_footer', 'remove_post_meta' );

    But it is not working.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your code cannot work because there is no such hook. I see 2 possibilities:

    a) You create a child theme and copy the file content.php to it. There you then remove the output from the section.
    b) You hide the section using CSS:

    footer.entry-meta { display: none }

    You would have to store this in Appearance > Customiser > Additional CSS.

    Thread Starter twentytwelveuser

    (@twentytwelveuser)

    But I need to remove it with hooks. What hook is there in TwentyTwelve?

    I don’t want to use CSS. And I want to hide post meta ONLY from tags archive.

    I have looked in the source code of content.php and see no hooks there. So unfortunately it doesn’t work this way.

    A 3rd possibility would be to overload the function twentytwelve_entry_meta(). Create this function in the child theme

    function twentytwelve_entry_meta() {}

    This means that there is no output via this function. This just worked in my test.

    Thread Starter twentytwelveuser

    (@twentytwelveuser)

    ok, thank you! I added IF statement to use the code everywhere except TAG:

    function twentytwelve_entry_meta() { 
       if (!is_tag())
        {      
         // twentytwelve_entry_meta() body from parent
        }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Meta from TAG archives’ is closed to new replies.