Category — Wordpress

How to Disable WordPress Built-in RSS Feed

I love WordPress built-in RSS feed, but I know some of you might not require this WordPress built-in RSS feed and thinking want to disable it from your blog or website, then you can follow the below steps by adding some simple code to your functions.php file, that’s all!

function digwp_disable_feed() {
	wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>'));
}
add_action('do_feed',      'digwp_disable_feed', 1);
add_action('do_feed_rdf',  'digwp_disable_feed', 1);
add_action('do_feed_rss',  'digwp_disable_feed', 1);
add_action('do_feed_rss2', 'digwp_disable_feed', 1);
add_action('do_feed_atom', 'digwp_disable_feed', 1);

Thanks Jeff Starr shows us how to disable WordPress built-in RSS feed.

Add a rel=”nofollow” Attribute to All External Links on Your WordPress Blog

WordPress doesn’t automatically add a rel=”nofollow” attribute to all the external links, but if you want to add a rel=”nofollow” attribute link to all external links, you can do it by copy and paste the following coding to the functions.php file.

add_filter('the_content', 'auto_nofollow');

function auto_nofollow($content) {
    //return stripslashes(wp_rel_nofollow($content));

    return preg_replace_callback('/<a>]+/', 'auto_nofollow_callback', $content);
}

function auto_nofollow_callback($matches) {
    $link = $matches[0];
    $site_link = get_bloginfo('url');

    if (strpos($link, 'rel') === false) {
        $link = preg_replace("%(href=S(?!$site_link))%i", 'rel="nofollow" $1', $link);
    } elseif (preg_match("%href=S(?!$site_link)%i", $link)) {
        $link = preg_replace('/rel=S(?!nofollow)S*/i', 'rel="nofollow"', $link);
    }
    return $link;
}

Thanks to One Extra Pixel for the great code!

How to Remove URL Field from WordPress Comment Form

Some people like to leave their comments on your post with website url, I think most probably they want to get link juice from your comments. If you want to remove url field from WordPress comment form, perhaps you can paste the below code to your functions.php file. Once it is saved, the url field will be automatically removed from your comment form.

function remove_comment_fields($fields) {
    unset($fields['url']);
    return $fields;
}
add_filter('comment_form_default_fields','remove_comment_fields');

Thanks for WP Tuts for the great code!

Free WordPress Theme – Simple Grid

I was thinking to create a new website for web design and I think Free wordPress Theme named Simple Grid is suit to my requirement. I can showcase my portfolio in the main page to show to my visitors or customers. You can go through the theme features as below:

Menus…
Responsive Theme
For Menus Name use: header_menu
For Category Name use: category_menu

Valid XHTML + CSS
WordPress 3.3+ Compatible
Search Engine Optimized
Safari Compatible
Firefox Compatible
IE9 Compatible
Support and Updates
Theme Video Overview

Theme Options
Menus Capability
Widgets

If you love this love, look at their demo here and click the download link to download it. I hope you like this free WordPress Theme

How to Display RSS Feeds on Your WordPress Blog

Wonder how to display rss feed in your WordPress blog without using the deprecated wp_rss() function? Paste the following code wherever you want to display the feed. Don’t forget to update the feed url on line 3. Number of items to be displayed can be defined on line 6.

<?php
include_once(ABSPATH . WPINC . '/rss.php');
$feed = 'http://example.com/feed/';
$rss = fetch_feed($feed);
if (!is_wp_error( $rss ) ) :
    $maxitems = $rss->get_item_quantity(3);
    $rss_items = $rss->get_items(0, $maxitems);
    if ($rss_items):
        echo "<ul>\n";
        foreach ( $rss_items as $item ) : 
            echo '<li>';
            echo '<a href="' . $item->get_permalink() . '">' . $item->get_title() . "</a>\n";
            echo '<p>' . $item->get_description() . "</li>\n";
        endforeach;
        echo "</ul>\n";
    endif;
endif;
?>

Thanks to Dan Gayle for the best coding!

How to Embed YouTube in WordPress

Do you know how to embed YouTube in WordPress? This is so simple I tell you! Don’t get surprise because it is simple as one click. LOL!! There are 2 ways to embed YouTube in WordPress, the faster way is just paste the YouTube link in your WordPress Rich Text Editing in HTML mode and another way is to copy and paste the following code to your WordPress Rich Text Editing in HTML mode too.

<object type=”application/x-shockwave-flash” width=”425″ height=”350″ data=”http://www.youtube.com/url”><param name=”movie” value=”http://www.youtube.com/url” /></object>

Make sure to replace the video URL with the one you’re using in your blog.

There’s also a quick way of adding YouTube or other videos to your blog by using Video Quicktags plugin.

How to Prevent WordPress Compress Your Images

When images are uploaded, WordPress automatically sets the image compression to 90. Therefore, the quality of the images will be affected due to this image compression, but the good thing is that the file size of the images will become smaller. I know some of you may want the quality of the images and you think it is important to keep the good quality of images, then you can copy and paste the following code to your functions.php WordPress file and save it, that is so simple and you are done!

add_filter('jpeg_quality', function($arg){return 100;});

Thanks to WP Snippets for the best code!

6 Color Styles Free WordPress Theme – Simplo

Are you looking for elegant and free WordPress theme with social bookmarking links? If yes, Simplo is the right choice for you! Simplo is a free WordPress theme comes with many features like Built-in Pagination, JQuery PrettyPhoto Lightbox, Ajax based contact form, Dropdown Menu and many more. The good of Simplo is it has 6 color styles which you can change the theme color according to your mood. Don’t miss it if you like Simplo WordPress theme, it is free for download.

Page 1 of 10123456...Last »