WordPress.org

Support

Support » Themes and Templates » unable to use just one category

unable to use just one category

  • saltyessentials
    Member

    @saltyessentials

    Hi. I’m hoping you can help me, because I really love your theme. I’ve just published my first post and discovered that I can’t use just one category. If I have only one selected, nothing appears for the post. If I choose two categories for the post, both appear on the blog. But unselecting either one of them in my dashboard makes both disappear on the blog. Can you offer any advice or a fix? Thanks so much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Caroline Moore
    Member

    @sixhours

    Categories will only appear if you have more than one active category of posts (since it’s not really a “category” if you only have one :)). A quick, non-code fix is to add a second dummy category and add a Private post to it. That should trigger the category to display without actually making the second category public.

    saltyessentials
    Member

    @saltyessentials

    Hi Caroline. I appreciate your quick response. I’m not sure I explained myself clearly. When I use your theme and add either the category of “Truth” or of “Wholeness” to my post, the post shows no categories below it. If I add both the categories of “Truth” and “Wholeness” to the post, I then see both categories at the bottom of the post. If I add just the single category to the post (say, “Wholeness”) and then change to another theme, that category shows up at the bottom of my post. When I change back to your theme, the category disappears again. So a single category seems to work in other themes, but not yours. Is this a limitation of your theme? Thanks a gain for your time. Dan

    Theme Author Caroline Moore
    Member

    @sixhours

    Yes, this is the intended behavior. Themes choose how to implement categories, so their display will differ from theme to theme. Once you start creating most posts and adding them to multiple categories, the categories will display.

    Michael
    Moderator

    @alchymyth

    this behaviour will stop automatically once you have at least two categories with posts in your site.

    if you want to change it now, edit content.php; find:

    if ( $categories_list && sixhours_categorized_blog() ) :

    remove exactly: && sixhours_categorized_blog()

    so you are left with:

    if ( $categories_list ) :

    then edit content-single.php and change this section:

    if ( ! sixhours_categorized_blog() ) {
    				// This blog only has 1 category so we just need to worry about tags in the meta text
    				if ( '' != $tag_list ) {
    					$meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				} else {
    					$meta_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				}
    
    			} else {
    				// But this blog has loads of categories so we should probably display them here
    				if ( '' != $tag_list ) {
    					$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				} else {
    					$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				}
    
    			} // end check for categories on this blog

    to:

    if ( '' != $tag_list ) {
    					$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				} else {
    					$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'sixhours' );
    				}

    saltyessentials
    Member

    @saltyessentials

    Got it. Thanks for your patience with me. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘unable to use just one category’ is closed to new replies.