Unneeded Meta tags in WordPress

Sometimes in your theme unneeded meta tags show up. They look like

<meta content="noindex,follow" name="robots"/>

or something like this.
I have seen three reasons for this:

  • Plugin settings. In this case check your plugins, uncheck what's needed. Main plugin candidates: All in One SEO Pack, other seo plugins.
  • Blog Privacy atributes. In this case go to Settings -> Privacy and check

I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers

  • Hard coded values in theme files.  In this case go to Appearance -> Editor and delete such meta tags from theme files.

WordPress and SimplePie functionality

SimplePie functionality for your blog:
function fetch_feed_modified($url) {
 require_once  (ABSPATH . WPINC . '/class-feed.php');
 $feed = new SimplePie();
 $feed->set_feed_url($url);
 $feed->set_cache_class('WP_Feed_Cache');
 $feed->set_file_class('WP_SimplePie_File');
 $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200));
 $feed->init();
 $feed->handle_content_type();

 if ( $feed->error() )
 printf ('There was an error while connecting to Feed server, please, try again!');

 foreach ($feed->get_items() as $item){
  printf('<li><a href="%s">%s</a>',$item->get_permalink(), $item->get_title());
 printf(' <small>%s</small></li>',$item->get_date());
 }
}

function ms_smallpie_feed($uri) {
 if(function_exists('fetch_feed_modified')) {
 fetch_feed_modified($uri);
 }
}

Continue reading WordPress and SimplePie functionality

How to add WordPress sidebar

There comes a time in every WordPress developer life when he/she needs to add a sidebar. Don't be afraid, my friend! It's not as hard as it sounds like 🙂

To get that done you need functions.php and as many sidebar-<something unique>.php files as you many sidebars you want. All tucked inside your theme folder.

They all can be empty for now. We'll fill them out soon.

First, functions.php:

<?php
if ( function_exists('register_sidebar') )
register_sidebar('left');
register_sidebar('right');
?>

Continue reading How to add WordPress sidebar

Dropdown menu

A few days a go I needed to change default Modularity theme dropdown menu from onclick like functionality to onmouseover like functionality.

It was easy. But, the script they use, it didn't work with IE6: I needed to find another way. Now, it is possible to write such script from scratch, but: if there exists an existing script, why bother.

I couldn't find an existing, simple plugin for WordPress, so went looking for general purpose frameworks.
I found this: Free CSS Drop-Down Menu Framework. It's free and licensed under the GNU General Public License.

Here is how to add it to your WordPress theme:
Continue reading Dropdown menu