Tagged: hentry error
-
AuthorPosts
-
July 19, 2016 at 6:40 pm #662673
Hello,
I am very happy with the Enfold theme. Briljant.
But..
In my Webmaster Tools I see a hentry error on pages with a masonry gallery. like http://rogercremers.com/portrait/The error only shows up on pages with ‘Element caption’ is ‘display title’, on pages with ‘Element caption’ is selected to ‘display neither’ there is no problem.
The error is missing Author and missing updated.
Is it possible to fix this ?
thanks in advance,
Roger
July 23, 2016 at 5:12 am #664120Hey Roger,
Thank you for using Enfold.
The masonry element do not contain the author info by default because it is not usually use to display blog posts. The masonry element is commonly use to showcase an individual or a company’s portfolio or projects. You will have to modify the masonry shortcode file if you want to add that info. Please hire a freelance developer or contact codeable: http://kriesi.at/contact
Best regards,
IsmaelAugust 4, 2016 at 9:57 am #668460Hello Ismael,
It is not masonry blogposts, but a photo gallery.
Strange why is it working with ‘Element caption’ is selected to ‘display neither’ and NOT with ‘Element caption’ is ‘display title’
So it is working, but only on one setting.
August 9, 2016 at 5:21 am #670153Hi,
Strange why is it working with ‘Element caption’ is selected to ‘display neither’ and NOT with ‘Element caption’ is ‘display title’
Please post the login details here so that we can check it. Could you please provide a screenshot of the data structure testing tool result?
Best regards,
IsmaelAugust 10, 2016 at 10:17 pm #671082Hi, same issue here. Screenshot and url are in the private section.
August 15, 2016 at 3:34 am #672428Hi,
Modify the masonry shortcode file if you want to add the author info in the masonry element. Please hire a freelance developer or contact codeable: http://kriesi.at/contact
Best regards,
IsmaelAugust 16, 2016 at 8:53 pm #673393I don’t want to add the author info, that is not important because its just a masonry gallery. I would like to get rid off the errors in Google webmaster tools.
I added the default masonry gallery from the Enfold theme and that is creating errors in Google webmaster tools. I don’t understand why i should hire a freelance developer to fix this.August 19, 2016 at 1:45 pm #674762Hi
I agree with ‘Dutchman’ that it is strange to hire a developer to fix a problem.
Enfold is so completely good written, only these Hentry mark-ups are missing.See my screenshot in private section.
have a nice weekend
roger
August 21, 2016 at 5:59 am #675196Hi,
I don’t want to add the author info, that is not important because its just a masonry gallery. I would like to get rid off the errors in Google webmaster tools.
You can see those errors because google is looking for the author and date info which is not included in the masonry template. You have to modify the config-templatebuilder > avia-shortcodes > av-helper-masonry.php file. Or use the “avf_masonry_loop_prepare” filter. Example here:
https://kriesi.at/support/topic/display-the-post-category-above-the-title-in-masonry-view/
Best regards,
IsmaelAugust 21, 2016 at 11:04 am #675286Hi Ismael,
Thanks, I will try to figure it out.
August 21, 2016 at 11:25 am #675290Question for understanding: Why is the author info not included in the masonry template?
August 21, 2016 at 4:49 pm #675373overhere a freelance developer provided the solution for the same missing hentry items in Portfolio.
Hi,
We are very sorry for the delay. Look for this code around line 515:
if(!empty($title_link))
{
$output .= ““.$title.”“;
}
else
{
$output .= “”.$title.””;
}$output .= ‘</h3>
</header>’;
.. below, add this code:ob_start();
the_author_posts_link();
$author = ob_get_clean();$output .= ‘<span class=”blog-author minor-meta”>’.__(‘by’,’avia_framework’).” “;
$output .= ‘<span class=”entry-author-link” >’;
$output .= ‘<span class=”vcard author”><span class=”fn”>’;
$output .= $author;
$output .= ‘</span></span>’;
$output .= ‘</span>’;
$output .= ‘</span>’;
Best regards,
IsmaelAnyone with a solution for the ‘missing Author and Updated’ in a Masonry gallery?
August 24, 2016 at 4:18 am #676731Hi!
@Tobiy: One of the reasons was provided here: https://kriesi.at/support/topic/masonry-gallery-hentry/#post-664120
@Dutchman: Thanks for the link. You can implement that in the av-helper-masonry.php file but we don’t recommend adding modifications in the core files of the theme and will only suggest it as a last resort.
Best regards,
IsmaelAugust 24, 2016 at 8:14 am #676844Hi Ismael,
Ok i understand. I can not find the code in the av-helper-masonry.php to add the new code below it.
August 28, 2016 at 5:59 am #678564Hey!
Instead of modifying the av-helper-masonry.php file, please try this in the functions.php file:
add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_mod', 10 ,2); function avf_markup_helper_attributes_mod($attributes, $args) { if($args['context'] == 'entry_title') $attributes['itemprop'] = 'text'; return $attributes; }
Cheers!
IsmaelOctober 9, 2017 at 11:21 am #861836Hi Ismael,
i have also the problem with the hentry (Markup: microformats.org). Ther are noch attributes für “update” and “author”.
I have copy your code on the answer befor in the function:
But the i can see only “entry_title” in the code? I have to change “entry_titel” to “entry_update” and “entry_author” ?Sorry for my silly question, but i´m not fix in php, so i can only copy an paste?
Thank for helping:
This code i copy into thr function.php of my child.
add_filter(‘avf_markup_helper_attributes’, ‘avf_markup_helper_attributes_mod’, 10 ,2);
function avf_markup_helper_attributes_mod($attributes, $args) {
if($args[‘context’] == ‘entry_title’) $attributes[‘itemprop’] = ‘text’;
return $attributes;
}October 12, 2017 at 4:04 am #863112Hi,
The properties “entry_update” and “entry_author” is not included in the masonry template by default so you have to modify the config-templatebuilder > avia-shortcode > av-helper-masonry.php file.
Best regards,
IsmaelOctober 12, 2017 at 8:05 am #863244Hi Ismael,
thanks for your answer. Can you send me the code i have to change in the av-helber-masonry.php to get the hentry for update and author?
I have running the newest Version from Enfold (3.8.4)Thanks.
AlexOctober 13, 2017 at 11:59 am #863875Hi,
You can refer to the following link for the “author” schema code and implement it in the masonry template.
// https://kriesi.at/support/topic/hentry-missing-in-portfolio-entries/#post-654588
For the date, use this filter.
Or just use this filter in the functions.php file which is a combination of the two.
add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_schema', 10, 2 ); function avf_masonry_loop_prepare_mod_schema( $key, $entries ) { $output = ''; $separator = ' '; $date = get_the_date('d.m.y'); ob_start(); the_author(); $author = ob_get_clean(); $output .= '<span class="blog-author minor-meta">'.__('by','avia_framework').' '; $output .= '<span class="entry-author-link">'; $output .= '<span class="vcard author"><span class="fn">'; $output .= $author; $output .= '</span></span></span></span>'; $output .= '<span itemprop="dateModified" style="display: none;">' . esc_html( $date ) . '</span>' . $separator; $key['text_before'] .= $output; return $key; }
Best regards,
IsmaelOctober 23, 2017 at 8:46 am #867491Hi Ismael,
i try to put you combination Code in the funktion.php. But the date is not work für hentry.Pleas take a look in the private content.
Best regards,
alexOctober 24, 2017 at 5:45 am #867967Hi,
The “datemodfied” itemprop attribute was added on every items and I don’t see any errors in the data structure testing tool. Please remove the browser cache then check the page again.
Best regards,
IsmaelDecember 1, 2017 at 9:51 am #883786Hi Ismael,
I wait some days, so google crawl it new.
In the google search console i can find for hentry only “title” and “author”.Look at this screenshots:
https://www.dropbox.com/s/lhezejpg4gsckma/Screenshot.png?dl=0Hentry Screenshot: There is no date!
https://www.dropbox.com/s/coafgd3zhz8bqvz/hentry_screen.png?dl=0Can you help me?
Thanks.
AlexDecember 4, 2017 at 4:05 am #884496Hi,
Please try to remove the “display” property in the filter.
$output .= '<span itemprop="dateModified" style="display: none;">' . esc_html( $date ) . '</span>' . $separator;
Replace it with this code.
$output .= '<span itemprop="dateModified">' . esc_html( $date ) . '</span>' . $separator;
Best regards,
IsmaelDecember 4, 2017 at 9:29 am #884555Hi Ismael,
this changes the screen, by mouseover the pictuere. But there is no authordate in the hentry.
https://www.dropbox.com/s/w5qa7chf21pyls2/date_mouseover.png
https://www.dropbox.com/s/is93zssngx0tx8g/hentry_04-12-2017.pngBest regard,
Alex- This reply was modified 7 years ago by alex_0111.
December 5, 2017 at 2:05 pm #885056Hi,
Thank you for the update. Please try to add the “content” attribute to the same line.
$output .= '<span itemprop="dateModified" content="'.esc_html( $date ).'">' . esc_html( $date ) . '</span>' . $separator;
Best regards,
IsmaelDecember 5, 2017 at 4:31 pm #885131Hi, I do this, but i don´t get any date in the hentry. Do you have an other Idea?
May you can take a look to my webside. LogIn you will see in the private area.Thanks.
Alex/* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_schema', 10, 2 ); function avf_masonry_loop_prepare_mod_schema( $key, $entries ) { $output = ''; $separator = ' '; $content = get_the_time('c', $entries->ID); $date = get_the_time('F j, Y', $entries->ID); ob_start(); the_author(); $author = ob_get_clean(); $output .= '<span class="blog-author minor-meta">'.__('by','avia_framework').' '; $output .= '<span class="entry-author-link">'; $output .= '<span class="vcard author"><span class="fn">'; $output .= $author; $output .= '</span></span></span></span>'; $output .= '<meta itemprop="datePublished" content="'.esc_html( $content ).'">'; $output .= '<span itemprop="dateModified" content="'.esc_html( $content ).'">' . esc_html( $date ) . '</span>' . $separator; $key['text_before'] .= $output; return $key; }
December 7, 2017 at 6:39 am #885946Hi,
Did you disable the functions.php file?
We adjusted the code in the functions.php file, specifically these parts.
$content = get_the_time('c', $entries->ID); $date = get_the_time('F j, Y', $entries->ID);
and..
$output .= '<meta itemprop="datePublished" content="'.esc_html( $content ).'">'; $output .= '<span itemprop="dateModified" content="'.esc_html( $content ).'">' . esc_html( $date ) . '</span>' . $separator;
Please try it again.
Based on: https://www.receptional.com/common-schema-problems-how-to-fix-them/
Best regards,
IsmaelDecember 13, 2017 at 12:32 pm #888287Hi Ismael,
I get a problem with the function.php, so i have to deactivated temporary.
I gave this Job to an programer. Now it works for Hentry.May some other people can use them:
add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_schema', 10, 2 ); function avf_masonry_loop_prepare_mod_schema( $key, $entries ) { $output = ''; $separator = ' '; $content = get_the_time('c', $entries->ID); $date = get_the_time('F j, Y', $entries->ID); ob_start(); the_author(); $author = ob_get_clean(); $output .= '<span class="entry-author-link" >'; $output .= '<span class="vcard author"><span class="fn" style="visibility: hidden;">'; $output .= $author; $output .= '</span>' . '<br />' . $separator; $output .= '<time style="visibility: hidden;" class="entry-date updated" datetime="'. esc_html( $content ) . '" pubdate>' . esc_html( $date ) . '</time>'; $key['text_before'] .= $output; return $key; }
Thanks for all.
AlexDecember 13, 2017 at 1:37 pm #888330 -
AuthorPosts
- You must be logged in to reply to this topic.