Community Forums › Forums › Archived Forums › General Discussion › Page title layout problem
- This topic has 3 replies, 1 voice, and was last updated 9 years, 9 months ago by SirTzusky.
-
AuthorPosts
-
March 8, 2015 at 8:54 am #143605SirTzuskyMember
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 #143688SirTzuskyMemberHas 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:
March 8, 2015 at 1:58 pm #143693SirTzuskyMemberSo, 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 #143695SirTzuskyMemberI 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; }
-
AuthorPosts
- The topic ‘Page title layout problem’ is closed to new replies.