Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter iygen

    (@iygen)

    I recieve this problem.
    Install plug-in Category SEO Meta Tags. Enable it. After this – change All-in-One seo plugin.

    Open “aioseop_class.php”.

    change function rewrite_title

    function rewrite_title( $header ) {
    		global $wp_query;
    		if ( ! $wp_query ) {
    			$header .= "<!-- no wp_query found! -->\n";
    
    			return $header;
    		}
    		if (is_product_category()) { } else {
    		$title = $this->wp_title();
    		if ( ! empty( $title ) ) {
    			$header = $this->replace_title( $header, $title );
    		}
    		}
    		return $header;
    	}

    find 3804 function wp_head()

    change on:

    function wp_head() {
    		if ( ! $this->is_page_included() ) {
    			return;
    		}
    		$opts = $this->meta_opts;
    		global $aioseop_update_checker, $wp_query, $aioseop_options, $posts;
    		static $aioseop_dup_counter = 0;
    		$aioseop_dup_counter ++;
    		if ( $aioseop_dup_counter > 1 ) {
    			echo "\n<!-- " . sprintf( __( 'Debug Warning: All in One SEO Pack meta data was included again from %s filter. Called %s times!', 'all-in-one-seo-pack' ), current_filter(), $aioseop_dup_counter ) . " -->\n";
    
    			return;
    		}
    		if ( is_home() && ! is_front_page() ) {
    			$post = aiosp_common::get_blog_page();
    		} else {
    			$post = $this->get_queried_object();
    		}
    		$meta_string = null;
    		$description = '';
    		// Logging - rewrite handler check for output buffering.
    		$this->check_rewrite_handler();
    		if ( AIOSEOPPRO ) {
    			//echo "\n<!-- All in One SEO Pack Pro $this->version by Michael Torbert of Semper Fi Web Design";
    		} else {
    			//echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
    		}
    		if ( $this->ob_start_detected ) {
    			echo 'ob_start_detected ';
    		}
    		//echo "[$this->title_start,$this->title_end] ";
    		//echo "-->\n";
    		if ( AIOSEOPPRO ) {
    			echo '<!-- ' . __( 'Debug String', 'all-in-one-seo-pack' ) . ': ' . $aioseop_update_checker->get_verification_code() . " -->\n";
    		}
    		$blog_page  = aiosp_common::get_blog_page( $post );
    		$save_posts = $posts;
    		if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
    			global $posts;
    			$opts    = $this->meta_opts = $this->get_current_options( array(), 'aiosp', null, $post );
    			$posts   = array();
    			$posts[] = $post;
    		}
    		$posts       = $save_posts;
    		$description = apply_filters( 'aioseop_description', $this->get_main_description( $post ) );    // Get the description.
    		// Handle the description format.
    		if ( isset( $description ) && ( $this->strlen( $description ) > $this->minimum_description_length ) && ! ( is_front_page() && is_paged() ) ) {
    			$description = $this->trim_description( $description );
    			if ( ! isset( $meta_string ) ) {
    				$meta_string = '';
    			}
    			// Description format.
    			$description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
    			$desc_attr   = '';
    			if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
    				$desc_attr = 'itemprop="description"';
    			}
    			$desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
    			if (is_product_category()) { } else {
    			$meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );}
    		}
    		// Get the keywords.
    		$togglekeywords = 0;
    		if ( isset( $aioseop_options['aiosp_togglekeywords'] ) ) {
    			$togglekeywords = $aioseop_options['aiosp_togglekeywords'];
    		}
    		if ( $togglekeywords == 0 && ! ( is_front_page() && is_paged() ) ) {
    			$keywords = $this->get_main_keywords();
    			$keywords = $this->apply_cf_fields( $keywords );
    			$keywords = apply_filters( 'aioseop_keywords', $keywords );
    
    			if ( isset( $keywords ) && ! empty( $keywords ) ) {
    				if ( isset( $meta_string ) ) {
    					$meta_string .= "\n";
    				}
    				$keywords = wp_filter_nohtml_kses( str_replace( '"', '', $keywords ) );
    				$key_attr = '';
    				if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
    					$key_attr = 'itemprop="keywords"';
    				}
    				$key_attr = apply_filters( 'aioseop_keywords_attributes', $key_attr );
    				$meta_string .= sprintf( "<meta name=\"keywords\" %s content=\"%s\" />\n", $key_attr, $keywords );
    			}
    		}
    		// Handle noindex, nofollow - robots meta.
    		$robots_meta = apply_filters( 'aioseop_robots_meta', $this->get_robots_meta() );
    		if ( ! empty( $robots_meta ) ) {
    			$meta_string .= '<meta name="robots" content="' . esc_attr( $robots_meta ) . '" />' . "\n";
    		}
    		// Handle site verification.
    		if ( is_front_page() ) {
    			foreach (
    				array(
    					'google'    => 'google-site-verification',
    					'bing'      => 'msvalidate.01',
    					'pinterest' => 'p:domain_verify',
    				) as $k => $v
    			) {
    				if ( ! empty( $aioseop_options["aiosp_{$k}_verify"] ) ) {
    					$meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
    				}
    			}
    
    			// Sitelinks search.
    			if ( ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) || ! empty( $aioseop_options['aiosp_google_set_site_name'] ) ) {
    				$meta_string .= $this->sitelinks_search_box() . "\n";
    			}
    		}
    		// Handle extra meta fields.
    		foreach ( array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
    			if ( ! empty( $aioseop_options["aiosp_{$meta}_tags"] ) ) {
    				$$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags"] ), ENT_QUOTES );
    			} else {
    				$$meta = '';
    			}
    		}
    		if ( is_page() && isset( $page_meta ) && ! empty( $page_meta ) && ( ! is_front_page() || empty( $front_meta ) ) ) {
    			if ( isset( $meta_string ) ) {
    				$meta_string .= "\n";
    			}
    			$meta_string .= $page_meta;
    		}
    		if ( is_single() && isset( $post_meta ) && ! empty( $post_meta ) ) {
    			if ( isset( $meta_string ) ) {
    				$meta_string .= "\n";
    			}
    			$meta_string .= $post_meta;
    		}
    		// Handle authorship.
    		$authorship = $this->get_google_authorship( $post );
    		$publisher  = apply_filters( 'aioseop_google_publisher', $authorship['publisher'] );
    		if ( ! empty( $publisher ) ) {
    			$meta_string = '<link rel="publisher" href="' . esc_url( $publisher ) . '" />' . "\n" . $meta_string;
    		}
    		$author = apply_filters( 'aioseop_google_author', $authorship['author'] );
    		if ( ! empty( $author ) ) {
    			$meta_string = '<link rel="author" href="' . esc_url( $author ) . '" />' . "\n" . $meta_string;
    		}
    
    		if ( is_front_page() && ! empty( $front_meta ) ) {
    			if ( isset( $meta_string ) ) {
    				$meta_string .= "\n";
    			}
    			$meta_string .= $front_meta;
    		} else {
    			if ( is_home() && ! empty( $home_meta ) ) {
    				if ( isset( $meta_string ) ) {
    					$meta_string .= "\n";
    				}
    				$meta_string .= $home_meta;
    			}
    		}
    		$prev_next = $this->get_prev_next_links( $post );
    		$prev      = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
    		$next      = apply_filters( 'aioseop_next_link', $prev_next['next'] );
    		if ( ! empty( $prev ) ) {
    			$meta_string .= "<link rel='prev' href='" . esc_url( $prev ) . "' />\n";
    		}
    		if ( ! empty( $next ) ) {
    			$meta_string .= "<link rel='next' href='" . esc_url( $next ) . "' />\n";
    		}
    		if ( $meta_string != null ) {
    			echo "$meta_string\n";
    		}
    
    		// Handle canonical links.
    		$show_page = true;
    		if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
    			$show_page = false;
    		}
    
    		if ( $aioseop_options['aiosp_can'] ) {
    			$url = '';
    			if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
    				$url = $opts['aiosp_custom_link'];
    			}
    			if ( empty( $url ) ) {
    				$url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
    			}
    
    			$url = $this->validate_url_scheme( $url );
    
    			$url = apply_filters( 'aioseop_canonical_url', $url );
    			if ( ! empty( $url ) ) {
    				echo '<link rel="canonical" href="' . esc_url( $url ) . '" />' . "\n";
    			}
    		}
    		do_action( 'aioseop_modules_wp_head' );
    		if ( AIOSEOPPRO ) {
    			echo "<!-- /all in one seo pack pro -->\n";
    		} else {
    			echo "<!-- /all in one seo pack -->\n";
    		}
    	}
    Plugin Support Steve M

    (@wpsmort)

    SEO for categories and tags (including product categories and tags) is only available in All in One SEO Pack Pro which you can purchase here – https://semperplugins.com/all-in-one-seo-pack-pro-version/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to off all-in-one seo for categories?’ is closed to new replies.