Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
hiding category meta for 'uncategorized' « ThemeShaper Forums

ThemeShaper Forums » Thematic

hiding category meta for 'uncategorized'

(2 posts)
  • Started 5 years ago by juanojeda
  • Latest reply from juanojeda
  • This topic is resolved

  1. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    juanojeda

    Member

    Hi,
    I'm trying to customize my theme to only display categories in the postfooter IF the categories is NOT 'Uncategorized'(catid=1). The code I have so far is:

    $postcategory .= '<span class="cat-links">';
    	if () {
    		if (is_single()) {
    			$postcategory .= __('This entry was posted in ', 'thematic') . get_the_category_list(', ');
    			$postcategory .= '</span>';
    		} elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */
    			$postcategory .= __('Also posted in ', 'thematic') . $cats_meow;
    			$postcategory .= '</span> ';
    		} else {
    			$postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', ');
    			$postcategory .= '</span> ';
    		}
    	}
    	else {
    		$postcategory = '';
    	}
        $postcategory = apply_filters('thematic_postfooter_postcategory',$postcategory);

    (thanks to Dannydamnboy in This thread).
    I wrapped the code in an if statement because I only want to display the $postcategory if the post has a category. However, I can't figure out what to put in the if brackets.

    Any suggestions?

    Posted 5 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    juanojeda

    Member

    I've come up with a solution that works.

    //get category name and store as variable $category
    	function catname() {
    		foreach((get_the_category()) as $cat) {
    			return $cat->category_nicename;
    		}
    	}
    	$category = catname();
    
    	//when to display categories
    
    	//if the post has a real category display the category in footer links
    	if ($category != "uncategorized") {	
    
        $postcategory .= '<span class="cat-links">';
    	if (is_single()) {
    			$postcategory .= __('This entry was posted in ', 'thematic') . get_the_category_list(', ');
    			$postcategory .= '</span>';
    		} elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */
    			$postcategory .= __('Also posted in ', 'thematic') . $cats_meow;
    			$postcategory .= '</span> ';
    		} else {
    			$postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', ');
    			$postcategory .= '</span> ';
    		}
    	}
    	//if the post is in the category 'uncategorized' don't display the categories
    	else {
    		$postcategory = '';
    	}
        $postcategory = apply_filters('thematic_postfooter_postcategory',$postcategory);

    (thanks to This article).

    and I've hidden the separator with CSS using

    body #main #container #content .category-uncategorized .entry-utility .meta-sep {
    	display: none;
    	}

    This may not be the most elegant solution, but I've only got a limited knowledge of php.

    If anyone has a suggestion for making this work in a cleaner way, I'd really appreciate it.

    Juan

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183