• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Page title layout problem

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Page title layout problem

This topic is: resolved

Tagged: microdata, page, remove, schema.org, template, title

  • This topic has 3 replies, 1 voice, and was last updated 10 years, 8 months ago by SirTzusky.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 8, 2015 at 8:54 am #143605
    SirTzusky
    Member

    Hello,

    I need some help with the titles on pages. I reposition my titles like this:

    // * Reposition titles on Page, Post and other single pages
    
    add_action( 'genesis_after_header','relocate_entry_title_singular' );
    function relocate_entry_title_singular() {
    
    if ( ! is_singular() )
    		return;
    		
    	echo '<div class="entry-header-wrapper"><div class="wrap">';
    		genesis_do_post_title();
    		
    	echo '</div></div>';
    
    	if ( is_page_template() )
    		return;
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
    	remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
    
    	if ( ! is_singular('post' ) )
    		return;
    	remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    }

    Everything is ok on archive and single post pages as you can see here:
    [url=http://postimg.org/image/erbpdzsml/full/][img]http://s14.postimg.org/xjnkhkp0x/archive.png[/img][/url]

    But on single pages (custom page templates) something is not ok with the layout. As you can see in this image:
    [url=http://postimg.org/image/97fwlc019/full/][img]http://s30.postimg.org/l9bafh99t/title.png[/img][/url]

    There is something there that interferes with the layout.
    <article class="post-191 page type-page status-publish entry one-five first" itemscope="itemscope" itemtype="http://schema.org/CreativeWork"><div class="entry-content" itemprop="text"></div></article>

    Can someone help me? I search everything and I can't find a solution. The markup and title are removed and repositioned after the header. Everything works great but that article page type-page is not.

    Thank you in advance.

    March 8, 2015 at 12:37 pm #143688
    SirTzusky
    Member

    Has something to do with the schema.org microdata. (I don't have any plugin installed that add schema.org microdata).

    Here are the print screen examples again:

    Archive and single post print screen

    Single pages (templates or not)

    March 8, 2015 at 1:58 pm #143693
    SirTzusky
    Member

    So, I am here:
    -Has something to do with the schema.org microdata
    -Found the code below here within genesis/lib/functions/markup.php
    My question is: How do I change the code so I can get rid of title markup or what is that above the loop on pages?
    Here is the print screen again.

    add_filter( 'genesis_attr_entry', 'genesis_attributes_entry' );
    /**
     * Add attributes for entry element.
     *
     * @since 2.0.0
     *
     * @param array $attributes Existing attributes.
     *
     * @return array Amended attributes.
     */
    function genesis_attributes_entry( $attributes ) {
    
    	$attributes['class']     = join( ' ', get_post_class() );
    	$attributes['itemscope'] = 'itemscope';
    	$attributes['itemtype']  = 'http://schema.org/CreativeWork';
    
    	//* Blog posts microdata
    	if ( 'post' === get_post_type() ) {
    
    		$attributes['itemtype']  = 'http://schema.org/BlogPosting';
    
    		//* If main query,
    		if ( is_main_query() )
    			$attributes['itemprop']  = 'blogPost';
    
    	}
    
    	return $attributes;
    
    }
    

    P.S.: I'm a newbie on working with Genesis, microdata etc 🙂 I hope that someone can help me. Thank you.

    March 8, 2015 at 2:49 pm #143695
    SirTzusky
    Member

    I solve this out thanks to this post: http://www.studiopress.community/topic/how-to-get-rid-of-entry-content-div/

    Here is the code:

    
    add_filter( 'genesis_attr_entry', 'prefix_attributes_entry_content', 15 );
    function prefix_attributes_entry_content( $attributes ) {
    	unset( $attributes['class'] );
    	unset( $attributes['itemprop'] );
    	unset( $attributes['itemtype'] );
    	unset( $attributes['itemscope'] );
    	//* Blog posts microdata
    	if ( 'post' === get_post_type() ) {
    		$attributes['class']     = join( ' ', get_post_class() );
    		$attributes['itemtype']  = 'http://schema.org/BlogPosting';
    
    	
    		//* If main query,
    		if ( is_main_query() )
    			$attributes['itemprop']  = 'blogPost';
    
    	}
    	
       
        return $attributes;
    }
    
  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Page title layout problem’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble