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
remove 'noindex' from category pages « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

remove 'noindex' from category pages

(5 posts)
  • Started 3 years ago by edensun
  • Latest reply from ScottNix
  • This topic is not resolved
  1. edensun
    Member

    Hello. After rummaging around in thousands of themes, i have finally found the one i like. I use thematic with the power blog child theme

    I want to remove the "noindex" attribute from category pages. Currently the source on my category pages shows <meta name="robots" content="noindex,follow" />

    Doing some research I found that in /library/extensions/header-extensions.php there is thematic_create_robots filter in which this code lives (thanks to helgatheviking)

    Now, I know i have to do something in my functions.php file in my child theme(power blog) to make this work. Any help would be appreciated.

    p.s. I am a php newbie.

    Thanks very much

    Eden

    Posted 3 years ago #
  2. edensun
    Member

    hey guys. can anyone please help me with this? I don't mean to be pushy but don't want my post to be forgotten.

    Thanks

    I really appreciate your time

    Posted 3 years ago #

  3. 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
    ScottNix

    Member

    Ok, this will change the noindex, nofollow meta to index, follow on the categories.

    // remove the index and follow tags from main pages and allow categories to be indexed
    function childtheme_create_robots($content) {
    	if (thematic_seo()) {
    		if((is_home() && ($paged < 2 )) || is_front_page() || is_single() || is_page() || is_attachment()) {
    		    $content = "";
    		} elseif (is_search()) {
    		    $content = "\t";
    			$content .= "<meta name=\"robots\" content=\"noindex,nofollow\" />";
    			$content .= "\n\n";
    		} elseif (is_category()) {
    		    $content = "\t";
    			$content .= "<meta name=\"robots\" content=\"index,follow\" />";
    			$content .= "\n\n";
    		} else {
    		    $content = "\t";
    			$content .= "<meta name=\"robots\" content=\"noindex,follow\" />";
    			$content .= "\n\n";
    		}
    	return $content;
    	}
    }
    add_filter('thematic_create_robots', 'childtheme_create_robots');

    This snippet will actually do one more thing too... It removes the "index, follow" tag from normal pages. Why? Because by default a page is already index, follow, so having it actually in the meta is redundant and just adds an extra line of code for no reason, so for cleanliness of code, I removed it.

    Posted 3 years ago #
  4. edensun
    Member

    Thanks ScottNix. Appreciate it a lot man. I am assuming that this gets pasted in my functions.php file?

    Posted 3 years ago #

  5. 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
    ScottNix

    Member

    Yup, you are correct, functions.php :)

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


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