WordPress.org

Ready to get started?Download WordPress

Forums

Microdata Manager
How to add on homepage (Genesis/Dynamik site) (4 posts)

  1. dathaeus
    Member
    Posted 7 months ago #

    Hi, I understand there are fields in every page/post for adding the md, but what about on the default homepage... where are the fields that I can use for that?

    Thank you!

    http://wordpress.org/plugins/microdata-manager/

  2. bradpotter
    Member
    Plugin Author

    Posted 7 months ago #

    Sorry for the late reply.

    You raise a valid point. If you are selecting a static page to use as your home page, it will work just fine. If you are using a widgetized home page it looks like Genesis uses an itemtype of Blog and you may not prefer that.

    I do plan to introduce a settings page which will apply site-wide changes so I will try to take a widgetized home page into account when I create the next version of MM.

    I do not have any plans for editing Schema on widgets at this time.

  3. bradpotter
    Member
    Plugin Author

    Posted 7 months ago #

    Follow-up on your question.

    You can change the content item type on the home page to something other than http://schema.org/Blog by using the following code snippet in your child theme functions file.

    add_filter( 'genesis_attr_content', 'bp_attributes_content' );
    /**
     * Change attributes for home page content element.
     *
     */
    function bp_attributes_content( $attributes ) {
    
    	$attributes['role']     = 'main';
    	$attributes['itemprop'] = 'mainContentOfPage';
    
    	//* Home page content element microdata
    	if ( is_home() ) {
    		$attributes['itemscope'] = 'itemscope';
    		$attributes['itemtype']  = 'http://schema.org/Blog';
    	}
    
    	return $attributes;
    
    }

    Change "http://schema.org/Blog" in the code snippet above to a valid item type. See http://schema.org for details

  4. bradpotter
    Member
    Plugin Author

    Posted 7 months ago #

    Simplified code:

    add_filter( 'genesis_attr_content', 'bp_attributes_content' );
    /**
     * Change attributes for home page main content element.
     *
     */
    function bp_attributes_content( $attributes ) {
    
    	//* Home page main content microdata
    	if ( is_home() ) {
    		$attributes['itemtype']  = 'http://schema.org/Blog';
    	}
    
    	return $attributes;
    
    }

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.