• Hi guys,

    I don’t know how to remove the category title in my blog – could you please help?

    Here’s the blog: https://cometoydc.com/category/podcasts/

    You can see the category title is: All posts in Podcasts

    I’ve checked out other help posts on here re. this, but the solutions I’ve tried keep stuffing up my blog. I’m probably just implementing them wrong. Here’s one I found: https://www.ads-software.com/support/topic/how-to-remove-category-title-1

    In archive.php, I have the following:

    <div class="navigation page-navigation">
    				<div class="nav-next"><?php next_posts_link(__('&larr; Older Entries', 'zilla')) ?></div>
    				<div class="nav-previous"><?php previous_posts_link(__('Newer Entries &rarr;', 'zilla')) ?></div>
    			<!--END .navigation .page-navigation -->
    			</div>
    
    			<?php else :
    
         			if ( is_category() ) { // If this is a category archive
        				printf( __('<h2>Sorry, but there aren\'t any posts in the %s category yet.</h2>', 'zilla'), single_cat_title('',false));
        			} else if ( is_date() ) { // If this is a date archive
        				echo(__('<h2>Sorry, but there aren\'t any posts with this date.</h2>', 'zilla'));
        			} else if ( is_author() ) { // If this is a category archive
        				$userdata = get_userdatabylogin(get_query_var('author_name'));
        				printf(__('<h2>Sorry, but there aren\'t any posts by %s yet.</h2>', 'zilla'), $userdata->display_name);
        			} else {
        				echo(__('<h2>No posts found.</h2>', 'zilla'));
        			}
    
    			endif; ?>
    
    			<!--END #primary .hfeed-->
    			</div>

    Is the correct code to remove in there?

    Any help would be great!

    Thanks,
    A.

Viewing 3 replies - 1 through 3 (of 3 total)
  • jack randall

    (@theotherlebowski)

    you can do this two ways: create an archive template and use that with the page title code taken out or you can hide it using css.

    css is probably the easiest method. hopefully you’re using a child theme for any and all you theme edits but if you’re not you should at the very least install a plugin to make changes to the css so that you’re not directly editing the theme itself (you’ll lose all of your hard work if the them upgrades itself…)

    in the css you need to add in

    div.page-header h1.page-title
    {
      display: none;
    }

    and that should remove it. however, this will remove it everywhere on the site so if you want to remove it in only one place you’ll need to be even more specific but we can cross that bridge if you come to it.

    Thread Starter andrewbergman223

    (@andrewbergman223)

    Hey Jack,

    Thanks for this. If I wanted to just remove the page title code (first option you suggested), what code would I remove?

    Thanks,
    A

    jack randall

    (@theotherlebowski)

    i’ve just checked and you’re using a paid for theme so for support with it you’ll need to head over to the developers https://www.themezilla.com/support/ and they should be able to help you. but, just as a primer for what they’re probably going to tell you to do read this: https://developer.www.ads-software.com/themes/template-files-section/page-template-files/page-templates/ for information of creating and modifying template files and this https://codex.www.ads-software.com/Child_Themes regarding child themes (which is where you’ need to create your new archive template file).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I remove the category title from my blog?’ is closed to new replies.