Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Wrapping sidebar with class="nocontent"


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Jan 4, 2012, 08:27 PM
ymf
 
61 posts · May 2009
I'd like to have something like
HTML Code:
<td id="right-inner" class="nocontent"> ... </td>
i.e. surround a sidebar (footer, header, widget...) area with a class="nocontent". Preferably, I'd like to do it without having to modify the theme's code .

Why I want it? -- to tell Google Custom Search that the sidebar has a boilerplate content that's not relevant to the main content of the page. When Google Custom Search sees this tag, they ignore any keywords it contains and won't take them into account when calculating ranking for the Custom Search engine (see http://support.google.com/customsear...answer=2364585).
  #2  
Old Jan 5, 2012, 07:15 AM
juggledad's Avatar
juggledad
 
22,322 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
the only way to do it, currently, is to modify the theme code.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jan 5, 2012, 09:09 AM
juggledad's Avatar
juggledad
 
22,322 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
why not add a text widget and put your boilerplate in it wrapped in a div with that class.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Jan 5, 2012, 09:53 AM
ymf
 
61 posts · May 2009
I want to exclude from Google Custom Search Engine (CSE) indexing the whole side bar with all its widgets. Not just one particular "boilerplate" widget.

For (an artificial) example, say I have a post titled "Hello World" placed in the category "Hello World" and also tagged "Hello World". When I search for a phrase "Hello World", I want Google's CSE to return precisely that one particular post. However, the words "Hello World" will be picked by "Recent Posts / Recent Comments / Categories / Tags" and who knows what other plugins, and placed on the navigation sidebars of all blog pages. I may also have an external blogroll link conveniently named "Hello World" -- it will also be in the navigation sidebars of all blog pages. Thus, the Google CSE will return all (irrelevant) blog posts, not just the one titled "Hello World".

My opinion: since Google stepped in with this class="nocontent" idea, we should all take a notice. It would be nice if Atahualpa could support this new concept in some future version.
  #5  
Old Jan 5, 2012, 10:14 AM
juggledad's Avatar
juggledad
 
22,322 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
for now you will need to edit header.php for the left and left-inner sidebars and footer.php for the right-inner and right sidebars.

actually it would be nice if someone created a plugin that would add that option to each widget you use.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Jan 7, 2012, 04:15 PM
ymf
 
61 posts · May 2009
wordpress.org/extend/plugins/zigwidgetclass/ seems to be exactly what the doctor prescribed:
Quote:
ZigWidgetClass adds a free text field to each widget control form on your widget admin page. Enter a class name in the box and it will be added to the classes that WordPress applies to that widget instance. It only works with widgets created by extending the built-in multi widget class
I will try it. People praise that this "ZigWidgetClass" plugin is compatible with "Widget Logic" plugin, another intriguing little gem.
  #7  
Old Jan 8, 2012, 04:58 PM
ymf
 
61 posts · May 2009
There was only one minor issue installing ZigWidgetClass: it didn't work with "BFA Recent Comments" widget (maybe because ZigWidgetClass only works with widgets created by extending the built-in multi widget class?). So I switched from "BFA Recent Comments" to "Better WordPress Recent Comments" (wordpress.org/extend/plugins/bwp-recent-comments/).

Still haven't checked whether this class="nocontent" works as advertised in Google Custom Search.

I wanted to share two other pointers about excluding portions of a page from indexing by search engines:

Yahoo! introduced in 2007 a similar class="robots-nocontent" that is supposed to exclude portions of a page from their mainstream search engine (see www.ysearchblog.com/2007/05/02/introducing-robots-nocontent-for-page-sections/).

Google AdSense has tags <!-- google_ad_section_start --> ... <!-- google_ad_section_end --> to emphasize portions of a page for ad targeting purposes (see support.google.com/adsense/bin/answer.py?hl=en&answer=23168).

Bookmarks

Tags
cse, google custom search, nocontent

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Menu bar has duplicate specification of attribute &quot;class&quot; hollidaysjohn Page & Category Menu Bars 4 Aug 23, 2010 12:45 PM
Can't figure out how to add code to display in <div class="opacityright"> schabadoo Header configuration & styling 3 May 24, 2010 06:40 AM
[SOLVED] &quot;class&quot; appearing above header and navbar DesignFlute Header configuration & styling 6 May 7, 2010 01:50 PM
Need to call <li class= "current-cat-parent"> for single posts b1tzmast3r Page & Category Menu Bars 5 Jan 25, 2010 03:48 PM


All times are GMT -6. The time now is 11:27 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.