Home Support Blog Way How can I hide category meta data in posts and excerpts?

This topic contains 15 replies, has 2 voices, and was last updated by  ProDesigns 1 year, 2 months ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #6720

    dbookbinder
    Participant

    I’d like to display posts without displaying the categories that are assigned to them, and I can’t figure out a way, in CSS, to do it with this theme. What do I need to put into the CSS editor to hide the category names for all displayed posts?

    Thanks, and thanks for this excellent theme!

    David

    #6721

    ProDesigns
    Keymaster

    Hi @David,

    You can use following CSS to hide categories of posts:

    span.cat-links {
        display: none;
    }
    #6722

    dbookbinder
    Participant

    Thank you. I like the cleaner look and really appreciate your support!

    #6723

    ProDesigns
    Keymaster

    You are always welcome David. If you need further help reach us anytime. Thanks!!!

    #6724

    dbookbinder
    Participant

    A related question: When I display a set of posts in a category, the list of excerpts is prefixed with “Category:”

    How can I get rid of that prefix so that I only see the name of the category? Also, how can I modify the font used for the category name and post titles? I’d like H1 to be smaller but I can’t find where you set it in styles.css (I’m not very familiar with css).

    Thanks again,
    David

    #6725

    ProDesigns
    Keymaster

    Hi @David,

    You can use following CSS to change font-size of heading

    h1.page-title {
        font-size: 25px;
    }

    To remove Category prefix there is no option in theme. However, if you have used child theme you can override it from there.

    We will try to provide this option in upcoming version of our theme.

    Thank you.

    #6726

    dbookbinder
    Participant

    Thank you. I haven’t used a child theme, but I could create one with a plug-in. (Sorry, I’m new to modifying themes.) How would I remove the category prefix if I create a child theme?

    Thank you again,
    David

    #6727

    ProDesigns
    Keymaster

    Hi @David,

    You can add following lines of code to remove category prefix at functions.php of child theme.

    add_filter( 'get_the_archive_title', 'blog_way_category_title_change');
    
    	function blog_way_category_title_change( $title ) {
    
    		if ( is_category() ) {
    
    			$title = single_cat_title( '', false );
    
    		} 
    
    	return $title;
    
    }

    Premium version of this theme Blog Way Plus comes with child theme. You can check it at themeforest:
    https://themeforest.net/item/blog-way-plus-minimal-wordpress-blog-theme/19848313?s_rank=1

    Hope you will like it.

    Thank you.

    #6728

    dbookbinder
    Participant

    I’m developing a website for a friend who will be buying the Pro version, but meanwhile I wanted to try out your code for removing the categories to show her what that would look like, along with other design ideas. I created a child theme but WordPress wouldn’t work when I added your code to functions.php. I also tried adding the code to functions.php in the main Blog Way theme, just to get it working for now, and that also crashed. Does this new function depend on features in the Pro version? If so, I’ll leave it alone until my friend is ready for the Pro version. If not, why would it crash the theme?

    Thanks again,
    David

    #6729

    ProDesigns
    Keymaster

    Hi @David,

    It is tested code. We have tested it in both main theme and child theme.

    If you can provide us your site url and logins details (FTP through our email) we can test it for you.

    Thank you.

    #6730

    dbookbinder
    Participant

    Thank you. I sent you an email with login information for my site. Much appreciated! I tried adding the code to the main theme, but it also crashed with a 500 error.

    #6731

    dbookbinder
    Participant

    I figured out how to create a limited FTP account and sent you the login information, as well as the WordPress login information, through your Contact message form.

    Thanks again! As far as I can tell, this is the last critical piece for her, as she plans to use categories in her menus, as you can see on my site, and wants to maintain a very clean interface that she can customize more than is possible with the Blog Way theme.

    David

    #6732

    dbookbinder
    Participant

    Sorry that you did not get my corrective email on logging into my account via FTP. I sent an email to you with the correct login information. You need to use the same username, but add @davidbookbinder.com to it. I didn’t realize that, because I don’t need to do that with my default FTP account. Sorry for the inconvenience, and thanks again for your generous help!

    David

    #6733

    ProDesigns
    Keymaster

    Hi @David,

    It looks like you have missed something while copying code.

    We have added same code in functions.php of your child theme and it is working well now.

    Cheers!!!

    #6734

    dbookbinder
    Participant

    Thanks. My mistake was copying the code from the email you sent instead of this forum. My email editor changed the single-quote characters to the ' character string, and that is what caused the errors. I should have double-checked back here!

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.