-
AuthorPosts
-
May 10, 2017 at 3:46 pm #791162
Hi. I was reading about the above mentioned topic and observed that content hidden on my toggles was not shown in google snippets or was not being indexed properly. I am requesting a modification in toggles as shown on this enfold demo page: http://kriesi.at/themes/enfold/shortcodes/toggles-accordions/
I want all toggles to remain open and automatically close after 3 seconds of page load. I also want your suggestion whether this will be better for my SEO. I am to use 3000-4000 words on one page so I want to keep everything tidy. The problem is that my keywords are also in that hidden content.
Thanks
May 10, 2017 at 5:58 pm #791245Hi there,
The code below should keep all tabs open until a user clicks to close them
function add_custom_script_1(){ ?> <script> (function($){ $(window).load(function() { var toggler = $('.toggler'); var togglewrap = $(toggler).next(); $(toggler).each(function(index, element) { $(togglewrap).css({ 'display' : 'block', 'position' : 'static', 'visibility': 'visible', 'width' : 'auto', 'z-index' : 1, }); $(this).addClass('activeTitle'); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script_1', 1);
The question on SEO…
Back in 2016 google did update their webmaster policy around tabbed / hidden content…
“Make your site’s important content visible by default. Google is able to crawl HTML content hidden inside navigational elements such as tabs or expanding sections, however we consider this content less accessible to users, and believe that you should make your most important information visible in the default page view.”
Not good :(
They did do a U-turn on this late last year and stated that tabbed / hidden content wouldn’t hurt SEO and would be indexed just with a lower authority than standard content. If you have content that is important it’s best to not hide it in any way especially if it has keywords in it. Hidding keywords away could be flagged as potential black hat.
Personally the idea of keeping all the tabs open seems like a good one. It’ll allow users to see all content and collapse what isn’t relevant AND keeps google happy.
3000 – 4000 words seems a little high but I don’t know the context of the page. People tend to turn off after reading a huge amount.
Just my two cents :)Hope that helps
TJ
- This reply was modified 7 years, 7 months ago by tjswarbs78.
May 10, 2017 at 7:02 pm #791281@tjswarbs78
thanks for reply. i agree with you on all points. since the words are more, that is why i want to keep toggles open – until they close automatically after 3-5 seconds. you have mentioned code to keep toggles open, but i want them to close also – not manually by user, but automatically after a few seconds. how to do that?May 11, 2017 at 8:23 am #791532How to automatically close the toggles after few seconds?
Timed closing is my question.
Can you change your code so that opened toggles close after 5 seconds?
May 11, 2017 at 5:35 pm #791769Hi,
Please add following code to Functions.php file in Appearance > Editor
function av_close_toggles(){ ?> <script> jQuery(window).load(function(){ setTimeout( function() { jQuery('p.toggler').removeClass('activeTitle'); jQuery('.toggle_wrap').removeClass('active_tc'); }, 5000); }); </script> <?php } add_action('wp_footer', 'av_close_toggles');
Best regards,
YigitMay 11, 2017 at 7:24 pm #791851Hi.
I tried code by @Yigit and code by @tjswarbs78 and combined code of both.function av_close_toggles(){ ?> <script> jQuery(window).load(function(){ setTimeout( function() { jQuery('p.toggler').removeClass('activeTitle'); jQuery('.toggle_wrap').removeClass('active_tc'); }, 5000); }); </script> <?php } add_action('wp_footer', 'av_close_toggles');
and
<?php /* * 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. */ function add_custom_script_1(){ ?> <script> (function($){ $(window).load(function() { var toggler = $('.toggler'); var togglewrap = $(toggler).next(); $(toggler).each(function(index, element) { $(togglewrap).css({ 'display' : 'block', 'position' : 'static', 'visibility': 'visible', 'width' : 'auto', 'z-index' : 1, }); $(this).addClass('activeTitle'); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script_1', 1); function av_close_toggles(){ ?> <script> jQuery(window).load(function(){ setTimeout( function() { jQuery('p.toggler').removeClass('activeTitle'); jQuery('.toggle_wrap').removeClass('active_tc'); }, 5000); }); </script> <?php } add_action('wp_footer', 'av_close_toggles');
But if toggles are already open, they do not close.
I think even 3 or 4 auto clicks on toggles can work too.
I don’t know java script. Just guessing. Please help me on this. Giving you admin passwords
- This reply was modified 7 years, 7 months ago by Zatara.
May 12, 2017 at 12:00 pm #792234Hi!
I removed other code and left only mine and created a private testing page. It works there.
Regards,
YigitMay 12, 2017 at 12:23 pm #792243After seeing “only your code” work, i want to re-phrase the question –
1. When page loads, i want all toggles to be open.
2. 5 seconds after page load, they all should close.What your code does –
1. All toggles remain closed on page load.
2. If i open a toggle, it closes automatically.
This is not what I want.Please provide code again. Thanks a lot for the efforts.
May 12, 2017 at 1:28 pm #792274did it this way
<?php /* * 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. */ function add_custom_script_1(){ ?> <script> (function($){ $(window).load(function() { var toggler = $('.toggler'); var togglewrap = $(toggler).next(); $(toggler).each(function(index, element) { $(togglewrap).css({ 'display' : 'block', 'position' : 'static', 'visibility': 'visible', 'width' : 'auto', 'z-index' : 1, }); $(this).addClass('activeTitle'); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script_1', 1); function av_close_toggles(){ ?> <script> jQuery(window).load(function(){ setTimeout( function() { jQuery('p.toggler').removeClass('activeTitle'); jQuery('.toggle_wrap').removeClass('active_tc'); jQuery('.toggle_wrap').css({ 'display' : 'none', 'position' : 'static', 'visibility': 'visible', 'width' : 'auto', 'z-index' : 1, }); }, 6000); }); </script> <?php } add_action('wp_footer', 'av_close_toggles');
May 12, 2017 at 9:04 pm #792494Hi,
IS that done?
Does it work properly for you?Best regards,
BasilisMay 12, 2017 at 9:49 pm #792516Yes. It works. Thanks for support.
May 13, 2017 at 6:51 am #792640Hi,
We glad that your problem was solved!
Let us if you need some assistance :)
Best regards,
John TorvikJanuary 28, 2018 at 5:08 am #903843Any ideas how to make tab section indexable?
Thanks in advance!January 28, 2018 at 12:50 pm #903868Tab sections are indexed by google. Only the value of data remains low. While a visible content may rank on google, tabbed content may have difficulty in ranking.
January 29, 2018 at 10:20 pm #904488Hi,
There is not an easy way to go through it we are afraid.
not possible to go through it a searchable way.Best regards,
BasilisFebruary 4, 2018 at 3:24 am #907346Thanks! Will try to avoid these elements.
-
AuthorPosts
- You must be logged in to reply to this topic.