WordPress.org

Ready to get started?Download WordPress

Forums

Sixhours
unable to use just one category (6 posts)

  1. saltyessentials
    Member
    Posted 1 year ago #

    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.

  2. Caroline Moore
    Member
    Theme Author

    Posted 1 year ago #

    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.

  3. saltyessentials
    Member
    Posted 1 year ago #

    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

  4. Caroline Moore
    Member
    Theme Author

    Posted 1 year ago #

    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.

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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' );
    				}
  6. saltyessentials
    Member
    Posted 1 year ago #

    Got it. Thanks for your patience with me. :-)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.