Forum Replies Created
-
AuthorPosts
-
Gary JonesMemberGary JonesMember
The "Primary" naming of the theme menu location has no influence on SEO. Genesis could have called it "Menu spot 1" and "Menu spot 2".
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberTry:
if ( genesis_site_layout() === __genesis_return_full_width_content() { return; }
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
September 4, 2014 at 8:25 am in reply to: How to Change the Google Snippet on the Foodie Theme #122751Gary JonesMemberSEO Settings -> Titles and Metas -> Home:
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberThe activation of WPSEO means Genesis disables its own SEO features, including the Genesis -> SEO Settings page, where the Semantic Heading setting is located. That's why you can't see it. However, it still may be having an affect, so you should disable WPSEO, head to Genesis -> SEO Settings and disable the semantic heading option, save, then re-enable WPSEO.
Let me know if that fixes the h1 headings for you - I'll register it as a bug if so.
You may also find the Genesis Accessible plugin (http://wordpress.org/plugins/genesis-accessible/) of interest.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberHave you selected the semantic heading option in the theme or seo settings box? This changes which element is used for certain headings.
I'm going to avoid telling you how to filter the change myself, as two accessibility folks have suggested that using aria-level is not good practice (it's not when better options are available). You'll hear how Genesis decides to fix this up when it's done.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberTony's solution is probably the best suggestion here.
genesis_attr_* won't work, as that's for attributes, not tags.
What has been turned on in Genesis 2.1 is
genesis_structural_wrap-{$context}
. Sogenesis_structural_wrap-footer
is the filter hook that you can use to amend the opening and closing markup using two filters, with the second argument on the filter being able to tell which context is happening.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMember+1 for everything Summer has said here.
I just run Xdebug profiler on my local VVV site, with a custom Genesis child theme active. Here's a snap of the results:
https://www.dropbox.com/s/ro62amgjcwbl62q/Screenshot%202014-07-15%2000.43.35.png
Important things to note:
* There were 1412 *different* functions called. Only two Genesis ones made the top of the list in my viewport.
* Look at the invocation counts for the ones you can see - some get called thousands of times, and one (and one further down the list) get called 11,000+ times. Making your site call one extra customisation function on your site therefore becomes negligible, assuming it's written correctly. Let's take the code snippet that was already in this thread (sorry Summer!)://* Add the post title filter add_filter( 'genesis_post_title_text', 'ct_modify_post_title' ); function ct_modify_post_title($post_title) { $post_title = 'Thoughts on ' . $post_title . ' from John'; return $post_title; }
That assigns a value to a variable, and then returns the variable. Why not just return the value? Not only will it save (picoseconds? of) time, it will make the code cleaner too:
add_filter( 'genesis_post_title_text', 'ct_modify_post_title' ); function ct_modify_post_title( $post_title ) { return 'Thoughts on ' . $post_title . ' from John'; }
The expensive functions are ones that access the database or the file system. You probably won't be doing the latter, and the former has caches at the WP and Genesis levels. A simple thing like returning a different string really is nanoseconds. If you want to test, then create a function that does the filter, and another which assigns the current microtime(true) to a variable, then run a for loop from 1 to 100,000, and then subtract the previous time variable from the new current microtime(true). The result will be the time for 100,000 executions, so assuming you've not got some caching going on, you can divide it by 100,000 to get the approximate time it takes for one call.
if it is going to appear modified in more than 2 locations, then it would better off in functions.php, so that you wouldn’t have to put the same snippet in 3-4 different templates.
This. This is the benefit of Genesis. The abstraction of data from logic is what makes Genesis so powerful. Why edit several templates to add a Google Ad into the same spot on each type of page (archive, home, single post, single page etc.) when you can do it once, and have it apply multiple times automatically? If you don't want it in all the places, then use the template hierarchy or conditionals that you've already discussed.
If you don't want a long functions file, then split it up into several logical files that make sense to you, and include them in functions.php file if you wish.
My plugin https://github.com/GaryJones/genesis-ignore-deprecated can help save a small bit of time as well, as it tells Genesis not to load the deprecated functions file, which stops 74 deprecated functions being defined unnecessarily.
In the grand scheme of things, your choice of theme, and how it's built is not even close to being the most important factor for the speed of your site. Server hardware, Nginx, Varnish, Memcache, HHVM vs mod-php vs php-fcgi, DNS, CDN and browser caches are all going to make far more impact on how quick your site appears to be, instead of worrying about a few extra function calls that helps to customise the theme.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberSpeak to Bill Erickson, he might have already written one, as he was initially set against that feature coming out back in Jan 2012 (though didn't actually happen until 2.0) 😉
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberYou're right, but it's not something that's likely to be fixed anytime soon.
The h4 is to tell search engines that it's not as important, as it would be if it were a h2. It's certainly not done for stylistic reasons, since classes are used for styling.
What you could do, is leave it as h4, but filter in an aria-level=2 attribute instead. This tells supporting user agents that it should be treated as a level 2 heading for the purposes of the document outline.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberHi Patrick,
I've not seen the OP code, but the evidence I see points to the problem being with OP, and the assumptions it's making with Genesis.
Your site (and another site I was linked to that showed the same problem and had OP installed) both have elements in the header that are not standard for Genesis - it has evidence of HTML5 Boilerplate for the Doctype and
<html>
tag for instance. This suggests that OP is either filtering the genesis_doctype, or have provided a header.php which themes should use, i.e. custom code.Before Genesis 2.1.0, Genesis used to filter a function called wp_title() so that it included the
<title>...</title>
tags. It was wrong that it did that, and it's possible that OP checked to see if a Genesis child theme was present and adjusted it's output accordingly. In pseudocode:if ( genesis child theme is active)
echo the title
else
echo <title>the title</title>This would also explain why changing to a non-Genesis child theme fixes the problem, since the condition fails, and OP adds the title tags.
However, Genesis 2.1.0 fixed this, so that in the Genesis header.php (which is then used by all child themes, unless it already has a custom header.php) the <title> tags were not part of what is returned. If the above pseudocode is still in place in OP, then you can see that although the Genesis child theme is still active, OP is just displaying the title with no tags.
If you look at the page you linked to, then your browser tab will show the page URL. This only tends to happen when the page has no title tag, or an empty title tag. In this case, it's no title tag. If you look at the source, the 11th line shows your page title, not wrapped in tags, where the title tag would usually be.
So while a change in Genesis did likely cause this problem, it was fixing something that was broken, and OP and its custom code has not kept up to date with the changes in Genesis 2.1.
(Again, all speculation as I've not seen the code for OP.)
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberHave you got some real URLs to share please?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberGot it!
Now it's all fixed, I took a look at the first site reported in the thread, and at the post tags. This was the link:
<a href="http://mallina-studio.com/рубрика/%d0%b0%d1%80%d1%85%d0%b8%d1%82%d0%b5%d0%ba%d1%82%d1%83%d1%80%d0%b0/" rel="category tag">Ар?…итектура</a>
The foreign language was a contributing factor, but only in so much as the slug for the term made up of non-Latin characters was encoded, and naturally some of those encodings start with
%d
, which is one of the placeholder combinations thatsprintf()
looks for.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberCan you tell me what Category or Tag names seem to be affected? (One link said only certain posts were - what common category or tag were assigned to those posts)?
Did they have a % character in them?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberCould you paste your functions.php file somewhere please? Either gist.github.com or pastebin or send it through to me via https://gamajo.com/contact if it contains private code.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberSnippet 4 updated (missing comma causing the unexpected '99').
Soenke - do you mean a literal string of "[post_categories]" is shown, and not the result of the shortcode?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
July 1, 2014 at 8:26 am in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #112432Gary JonesMemberIf you're untechy, I'd say to wait until 2.1.1 is out (hopefully, today), which will fix this for you.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberCan you make a note of your widgets, and then switch to another child theme or three to see if the issue still comes up? (Obviously, if you've got access to a staging server, do it on that rather than the live server)
Soenke - I didn't read your helpful information close enough. The code snippet you gave, along with the info of "The errors appear on home, categories and posts (not tags)" suggests that the problem is with the post_tags shortcode output? Am I understanding you correctly?
Let's try filtering out the post_tags shortcode. Can you add the following to the bottom of your functions.php file:
1)
add_filter( 'genesis_post_info', 'gmj_post_meta_filter', 99 ); add_filter( 'genesis_post_meta', 'gmj_post_meta_filter', 99 ); function gmj_post_meta_filter($post_meta) { return ''; }
That should cause the warnings to disappear, and make the post meta and post info (I don't know which section you've got the tags in) completely empty. If so, that's good.
Now change it to:
2)
add_filter( 'genesis_post_info', 'gmj_post_meta_filter', 99 ); add_filter( 'genesis_post_meta', 'gmj_post_meta_filter', 99 ); function gmj_post_meta_filter($post_meta) { return '[post_categories]'; }
Hopefully, categories will appear, but no warnings.
Now try:
3)
add_filter( 'genesis_post_info', 'gmj_post_meta_filter', 99 ); add_filter( 'genesis_post_meta', 'gmj_post_meta_filter', 99 ); function gmj_post_meta_filter($post_meta) { return '[post_tags before="Before: "]'; }
That may well make the errors appear.
Lastly, try:
4)
add_filter( 'genesis_post_info', 'gmj_post_meta_filter', 99 ); add_filter( 'genesis_post_meta', 'gmj_post_meta_filter', 99 ); function gmj_post_meta_filter($post_meta) { return '[post_tags]'; }
That will probably still have the warnings there.
If you can let me know what your results are for 1), 2), 3) and 4), then we can see if the post_tags shortcode is the culprit or not. Thanks!
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
July 1, 2014 at 2:11 am in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #112342Gary JonesMemberDid you clear your hosts cache etc Dawn?
If you want to send me with some FTP login details (server, port, username, password), then I can see if I can get it working for you. https://gamajo.com/contact
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberFredtoft, Mallina, Soenke,
One linking factor between your sites, is that the are all non-English (even if just the admin?). Soenke - were the other sites you found also possibly run in a different language?
Can you all please:
* temporarily disable all plugins, and if the problem disappears (clear your hosts cache and browser cache to be sure), then enable the plugins one by one and keep refreshing until the problem reappears.
* If not successful, and if you have them, remove any language files you have for Genesis and see if that's fixed it.Sorry this has affected you, but if you can try the above steps we might be able to narrow down the problem.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
-
AuthorPosts