Forum Replies Created
-
AuthorPosts
-
September 30, 2016 at 12:30 pm in reply to: Need to revert to Genesis prior to 2.4: download? #194012emmtreParticipant
I have the same problem after updating to 2.4 with content limit on all my sites and I think support has identified the issue.
January 20, 2016 at 9:20 pm in reply to: Problem with blogPosting functions.php – Genesis 2.2.6 update #177059emmtreParticipantDeena, please contact StudioPress support if you haven't solved your problem yet.
January 11, 2016 at 5:38 pm in reply to: Problem with blogPosting functions.php – Genesis 2.2.6 update #176266emmtreParticipantYou have to remove the genesis_entry_content action first and then add a new one with a different name like genesis_custom_post_image. I'm using the code below but you might have to adjust the hook genesis_before_entry_content and priority depending on your child theme. You also have to change the name of the featured image in wp_get_attachment_image_src to the one you are using. And you also have to remove the itemprop for entry images added by Genesis when using the code below to avoid duplicates. Please notice the conditional not is_singular since I'm using another code for single posts.
//* Add featured image meta for pages remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); add_action( 'genesis_before_entry_content', 'genesis_custom_post_image', 10 ); function genesis_custom_post_image() { if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) { $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'context' => 'archive', 'attr' => genesis_parse_attr( 'entry-image', array ( 'alt' => get_the_title() ) ), ) ); list( $url, $width, $height ) = wp_get_attachment_image_src( get_post_thumbnail_id(), 'featured' ); if ( ! empty( $img ) ) { echo '<div class="featured-image" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">'; printf( '<a href="%s" aria-hidden="true">%s</a>', get_permalink(), $img ); printf( '<meta itemprop="url" content="%s">', esc_url( $url ) ); printf( '<meta itemprop="width" content="%s">', esc_attr( $width ) ); printf( '<meta itemprop="height" content="%s">', esc_attr( $height ) ); echo '</div>'; } } }
//* Remove markup for entry images add_filter( 'genesis_attr_entry-image', 'remove_entry_image_attributes' ); function remove_entry_image_attributes( $attributes ) { unset( $attributes['itemprop'] ); return $attributes; }
emmtreParticipantSorry but I don't understand your comments. What have the child theme to do with my question. The breadcrumb function is a part of the Genesis framework. So my question is not related to a specific child theme.
emmtreParticipantI'm just trying to display the page number in the breadcrumb for the paged frontpage.
You are here: Home You are here: Home / Page 2 You are here: Home / Page 3
emmtreParticipantAny other information available about the helper script beyond this article?
emmtreParticipantI'm using Genesis Extender on all sites. No brainer to add shortcodes.
emmtreParticipantWoodlandCoyote, do you mind posting the solution?
emmtreParticipantYou shouldn't modify the Genesis files but here is what I did. Don't remember if I had to change anything else.
September 16, 2015 at 9:17 am in reply to: How to have a Genesis SEO/Schema Friendly Site Logo #165769emmtreParticipantYou can also use JSON-LD in the head tag if you don't want to mess with the code.
Also more practical if you want another logo (size and color) for search results.
<script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Organization", "url": "http://www.example.com/", "name": "Example Name", "logo": "http://www.example.com/logo.png" } </script>
emmtreParticipantI took the easy way out...
//* Hook welcome widget area before content add_action( 'genesis_before_loop', 'child_theme_welcome' ); function child_theme_welcome() { if ( is_front_page() && ! is_paged() ) { genesis_widget_area( 'welcome', array( 'before' => '<div class="welcome widget-area" itemscope itemtype="http://schema.org/CreativeWork">', 'after' => '</div>', ) ); } }
//* Register widget areas genesis_register_sidebar( array( 'id' => 'welcome', 'name' => __( 'Welcome', 'child_theme' ), 'description' => __( 'This is the welcome widget area.', 'child_theme' ), 'before_title' => '<h4 class="widget-title widgettitle" itemprop="headline">', ) );
<span itemprop="text">Content in text widget...</span>
emmtreParticipantIt can be done in different ways depending on your child theme and how images are displayed. You can also use the genesis_attr_entry-image filter to add attributes.
if ( is_single() ) { the_post_thumbnail('large', array('class' => 'alignleft post-image entry-image', 'itemprop' => 'image')); }
add_filter( 'genesis_attr_entry-image', add_image_markup' ); function add_image_markup( $attributes ) { $attributes['itemprop'] = 'image'; return $attributes; }
emmtreParticipantThanx Dave for your comments. Where do you see a wildcard in the code? I think you only can add attributes via the genesis_attr filter if the element/section have a valid html or a context declared. So the list of context/html in the articles are the only elements where you can use the filter. But you should be able to declare the widget with the required html markup and context to be able to use the genesis_attr filter. Maybe like the primary sidebar structure is done in Genesis? Please see the second article. So the question is how to combine these to make the genesis_attr filter to work for the widget?
https://wpbeaches.com/adding-attribute-html-section-genesis/
http://www.rfmeier.net/using-genesis_markup-with-html5-in-genesis-2-0/
//* Register my-custom-widget area genesis_register_sidebar( array( 'id' => 'my-custom-widget', 'name' => __( 'My Custom Widget', 'child-theme' ), 'description' => __( 'This is the my custom widget area.', 'child-theme' ), ) );
//* Hook my-custom-widget widget area before content add_action( 'genesis_before_loop', 'hook_my_custom_widget' ); function hook_my_custom_widget() { if ( is_front_page() && ! is_paged() ) { genesis_widget_area( 'my-custom-widget', array( 'before' => '<div class="my-custom-widget widget-area">', 'after' => '</div>', ) ); } }
genesis_markup( array( 'html5' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">', 'xhtml' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">', 'context' => 'my-custom-widget', 'echo' => false, ) );
//* Output primary sidebar structure genesis_markup( array( 'html5' => '<aside %s>' . genesis_sidebar_title( 'sidebar' ), 'xhtml' => '<div id="sidebar" class="sidebar widget-area">', 'context' => 'sidebar-primary', ) ); do_action( 'genesis_before_sidebar_widget_area' ); do_action( 'genesis_sidebar' ); do_action( 'genesis_after_sidebar_widget_area' ); genesis_markup( array( 'html5' => '</aside>', 'xhtml' => '</div>', ) );
emmtreParticipantNathan,
Yes but it's not only for the blog template pages. The BlogPosting markup is also missing for posts on the front page and the blog page set for displaying posts in WordPress settings. And since it's working in 2.2.0 something must have changed in the 2.2.1 version. I think it still needs to be there at least for backward compatible reasons and not to penalize websites that still use the blog template.
emmtreParticipantNathan,
I installed the develop version from GitHub and it looks better. But I'm not sure we are there yet. The breadcrumbs are now recognized as part of the WebPage for normal pages. But for blog, archive, single post pages, etc the breadcrumbs are recognized as an explicit BreadcrumbList. I don't know if it will have an impact or not. I'll send you an email with some test results to illustrate.
Did you see my other email? The BlogPosting markup is now missing for posts on the front page, blog page set for displaying posts and when using the blog template. Meta and author still get the right markup even if BlogPosting is missing on these pages. The BlogPosting markup is still there and correct for posts in archive and single post pages. I think this is the way the markup should look for all posts.
<article class="post type-post status-publish format-standard has-post-thumbnail entry" itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
emmtreParticipantNathan,
I found another possible markup issue. For normal pages this markup is added.
<div class="content-sidebar-wrap"> <main class="content" itemprop="mainContentOfPage">
But mainContentOfPage is only supposed to be used on schema.org/WebPageElement (and it's sub-classes).
So the breadcrumb markup for pages is't recognized as a normal BreadcrumbList by Google's testing tool.
And the whole webpage content is now interpreted as the name of the mainContentOfPage.
emmtreParticipantThe manually way to add the new markup of breadcrumbs in Genesis 2.2. Can genesis_build_crumbs or any other filter be used to add the markup automatically?
//* Customize single post breadcrumb add_filter( 'genesis_single_crumb', 'custom_single_crumb', 10, 2 ); function custom_single_crumb( $crumb, $args ) { $url = get_page_link( get_page_by_title( 'Blog' ) ); $title = Blog; if( is_singular( 'post' ) ) { $crumb = get_the_title(); return '<span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem"><a href="' . $url . '" itemprop="item"><span itemprop="name">' . $title .'</span></a></span>' . $args['sep'] . $crumb; } else { return $crumb; } }
emmtreParticipantOK I found some code examples from Bill Erickson. I skipped the idea to use only the main category and used a blog page instead in the breadcrumb to mimic the code above. The front page displays the latest post so this is another blog page. I guess this will work but then the new schema.org markup of bredcrumbs is missing. Any other ideas or filters to use to keep the markup or do I have to add it manually?
//* Customize single post breadcrumb add_filter( 'genesis_single_crumb', 'custom_single_crumb', 10, 2 ); function custom_single_crumb( $crumb, $args ) { if( is_singular( 'post' ) ) { $crumb = get_the_title(); return '<a href="' . get_page_link( get_page_by_title( 'Blog' ) ) . '">' . Blog .'</a> ' . $args['sep'] . ' ' . $crumb; } }
emmtreParticipantThanx Brad! I know about the usual bredcrumb filters but I'm looking for a way to exclude sub-categories in the breadcrumb for single posts and only display the main category in the breadcrumb to match the permalink settings. I have tried to search these forums and other sites but without success. Any other resources you can recommend? I have looked at genesis_breadcrumb_link, genesis_single_crumb and genesis_category_crumb but I can't figure out if it can be used for this.
emmtreParticipantBrad, when the plugin is activeted it ads some microdata to the class="content" which give errors with Google's structured data testing tool.
<main class="content" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">
Google doesn't recognize the property mainContentOfPage for an object of type Blog.
Any plans to update the plugin? I've been using it to easily add microdata markup like AboutPage or ContactPage to improve search results.
-
AuthorPosts