Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jorge Raigoza

    (@forfe15)

    Never mind x2.

    The correct filter is wpseo_sitemap_entry. This filter applies to all post and page elements.

    Return the $url parameter for the elements that you want. For the elements that you do not want, return (EMPTY).

    function sitemap_exclude_post( $url, $type, $post ) {
    
    	if ( $post->ID === 1 ) {
    		// Exclude
    		return '';
    	}
    	
    	return $url;
    }
    add_filter( 'wpseo_sitemap_entry', 'sitemap_exclude_post', 1, 3 );
    • This reply was modified 7 years, 7 months ago by Jorge Raigoza. Reason: grammar and styling
    Thread Starter Jorge Raigoza

    (@forfe15)

    Never mind. I misread the article. I always get confuse with the word Taxonomy:

    • Category
    • Tag
    • Link Category
    • Post Format
    • Custom Taxonomies

    Basically, I was trying to filter posts and pages using their ID instead of a taxonomy slug.

    Is there any way to filter per post ID using PHP?

    As Chris mentioned, this plugin doesn’t play well with themes.

    We have a non-bootstrap theme. When we load the plug-in, the whole layout goes out of place.

    At the beginning I tough I could fix it… After reviewing the issue, I noticed a whole file causing the issues (magee-shortcodes/assets/bootstrap/css/bootstrap.min.css). It resizes and changes layout to ALL generic components, e.g. buttons.

    Honestly, you should not do this for a plug-in.

    Thread Starter Jorge Raigoza

    (@forfe15)

    Closing topic

Viewing 4 replies - 1 through 4 (of 4 total)