how to remove noindex nofollow from wordpress

There are many SEO wordpress plugin which insert the nofollow attribute in link. Using our code you can remove noindex nofollow from wordpress website. If you want to remove the nofollow attribute in link then just use the following code.

how to remove noindex nofollow from wordpress

Open your functions.php file from your wordpress theme folder and put following code in that file.


function remove_nofollow($string) {
$string = str_ireplace(' rel="nofollow"', '', $string);
return $string;
}
add_filter('the_content', 'remove_nofollow');

how to remove noindex nofollow from wordpress
how to remove noindex nofollow from wordpress

show pdf in wordpress blog or website

Many people want to show there pdf files in wordpress blog. PDF is really popular format for showing the document with graphics and text and design and graphs. Without loosing the quality of text and graphics if we need to show the content then PDF is really nice format.

pdf in wordpress

pdf in wordpress
pdf in wordpress

In business world for presentation purpose all people mostly use the PDF document. Some wp developers asked about showing the pdf in wordpress.

For without any issue if you want to show the PDF document then you need to just open functions.php file and put following code in that file.
Following code I written for creating the shortcode in wordpress

function pdflink($attr, $content) {
return '<a href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>';
}
add_shortcode('pdf', 'pdflink');

For showing link of PDF file in article or post you need add the following lines in the article.

[pdf href=”http://yoursite.com/linktoyour/file.pdf”]View PDF[/pdf]

Note: Upload the PDF file to your wordpress and then get the path of PDF file and then put above lines in article.
Change the path as you required.
Above code will create pdf link for your pdf document in your site.

If you does not want to create PDF link in your site and you want to show the pdf doc in your site then use following code.

function pdfshow($attr, $content) {
return '<iframe src="http://docs.google.com/gview?url='.$attr['href'] .'&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>';
}
add_shortcode('pdfshow', 'pdfshow');

For showing the PDF file in article or post you need add the following lines in the article.

[pdfshow href=”http://yoursite.com/linktoyour/file.pdf”]View PDF[/pdf]

We are looking for pdf in wordpress post, wordpress pdf tutorial,  wordpress tutorial, wordpress documentation pdf, wordpress ebook pdf, wordpress book, wordpress ppt, wordpress tutorial for beginners this for wordpress. Here we can add the pdf support using my code in your wordpress sites.

Get Short Link from WordPress admin panel

WordPress tutorial, Get Short Link from WordPress admin panel. Many of them used bit.ly, tinyurl or is.gd sites. we used is.gd methods for shorten link.. Many people use the short link to post blog in twitter. Many of them use the bit.ly and tinyurl or is.gd websites. earlier I used the is.gd methods for shorten link.

Get Short Link from WordPress admin panel

From wordpress 3.0 wordpress introduced the shorten url functionality in wordpress. For enabling the shortlink in wordpress you need to open the functions.php from your theme folder and put the following code in that file.

the_shortlink($text = '', $title = '', $before = '', $after = '');

For more information about the the_shortlink method you should following URL
http://codex.wordpress.org/Function_Reference/the_shortlink

For showing the short link in your theme you need to use the following code in index.php or single.php or page.php file.

if ( function_exists('the_shortlink') ) the_shortlink( __('Shortlink'), __('Shortlink on this post'), ' ' );

This short url method is very useful for posting the URL in twitter or in any social networking site.

 

wordpress add featured image to rss feed

In Many RSS feed we always see the images are showing. We can put the featured image in wordpress rss feed. WP RSS feeds are very important for SEO purpose. If you show the featured image on RSS feed then that will be great.

wordpress add featured image to rss feed

You need to open the functions.php file and put following code in that file. Then if you check your rss feed then RSS feed will be showing the featured images in RSS feed.

function thumbnail_in_rssfeed($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<div style="float:left;">' . get_the_post_thumbnail($post->ID) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'thumbnail_in_rssfeed');
add_filter('the_content_feed', 'thumbnail_in_rssfeed');

This code will show the featured images in content and excerpt RSS feed.

how to add custom thumbnail size to wordpress

From wordpres 2.9 version we got the featured image option in wordpress.  We have given code to add custom thumbnail size to wordpress themes.  Means you can relate the image to wordpress post without showing in post.

how to add custom thumbnail size to wordpress

If you are using the wordpress 2.9.2 or greater version then this feature is available in your wordpress but you need to enable this feature in your worpdress by using following function.

open your functions.php file and put following code in that file for enable the featured post feature in your wordpress

add_theme_support( 'post-thumbnails' );

By default, WordPress gives you some image sizes when you upload an image. These image sizes are:

* Thumbnail
* Medium
* Large
* Full (the image you uploaded)

For showing the the featured image in your post you can use the following code

if ( has_post_thumbnail() )

the_post_thumbnail( 'thumbnail' );  // for showing the thubnail.
the_post_thumbnail( 'medium' ); // for showing the medinum size thubnail image
the_post_thumbnail( 'full' );  // for showing the full size thubnail image

If you want to only show the specific image size in featured thubnail then use the following code.

add_filter( 'post_thumbnail_size', 'my_post_image_size' );

function my_post_image_size( $size ) {
$size = 'medium';
return $size;
}

 

For fixing the old images issue with featured images.
You can use the following article.
https://purabtech.in/media-library-not-displaying-images-after-importing-posts/

Add Custom Content to End of RSS feed for wordpress

wordpress tutorial for, Add Custom Content to End of RSS feed for wordpress. WordPress has own wordpress api to designed many RSS feed format. code given here.

Add Custom Content to End of RSS feed for wordpress

RSS (most commonly expanded as Really Simple Syndication) is a family of web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format.

Add Custom Content to End of RSS feed for wordpress
RSS feed are very important. WordPress has own wordpress api to designed many RSS feed format.
In this tutorial I will show you how to add the custom text in your rss feed.
You just need to open your functions.php file and put following code in that file.

function feed_the_Filter($query) {
if ($query->is_feed) {
add_filter('the_content','add_to_feed');
}
return $query;
}
add_filter('pre_get_posts','feed_the_Filter');

function add_to_feed($content) {
$content .= '<p>Follow us on Twitter &amp;lt;a href="http://twitter.com/wordpressapi"&amp;gt;Wordpress API&amp;lt;/a&amp;gt;</p>';
$content .= '<p>Join our &amp;lt;a href="http://www.facebook.com/pages/wordpressapi/280021545846"&amp;gt;Wordpress API Facebook Community Page&amp;lt;/a&amp;gt;</p>';

return $content;
}

Set multiple excerpt length for custom post type wordpress

From wordpress 3.0 version wordpress intruded the custom post type function. Many wordpress theme developers are using custom post type method for showing different sections.

Set multiple excerpt length for custom post type wordpress

Many times we need to change the excerpt text length and showing on main landing page of custom post type.

Set multiple excerpt length for custom post type wordpress
Set multiple excerpt length for custom post type wordpress

You can set the different excerpt length for each custom post type. you just need to open functions.php file and put following code in file.


function new_excerpt_length($length) {
global $post;
if ($post->post_type == 'post')
return 32;
else if ($post->post_type == 'products')
return 65;
else if ($post->post_type == 'testimonial')
return 75;
else
return 80;
}
add_filter('excerpt_length', 'new_excerpt_length');

Using above code you can set the many excerpt lengths for your custom post type.

If you are still facing issue with custom post then please do write to me.

disable image upload for wordpress users

wordpress tutorial, disable image upload for wordpress users. If you want to restrict the normal author to upload media file your wordpress blog.  So you can use the following code in your functions.php file.

disable image upload for wordpress users

disable image upload for wordpress users
disable image upload for wordpress users

Following function will remove the upload media button from wordpress dashboard.


//remove the upload buttons for auther and other wordpress user
function removemediabuttons()
{
if($user-&amp;gt;wp_user_level &amp;gt;= 1) {
remove_action( 'media_buttons', 'media_buttons' );
}

}
add_action('admin_head','removemediabuttons');

Following code will remove the media library tab from the Add new post section for all the users.
Restricts media library access (subscriber) under the “add new post”

function remove_medialibrary_tab($tabs) {
unset($tabs['library']);
return $tabs;
}
add_filter('media_upload_tabs','remove_medialibrary_tab');

This hack is very important for wordpress developers. when you are developing the multiuser wordpress site.

how to hide wordpress login page error messages

wordpress tutorial, how to hide wordpress login page error messages. Here in this article We are Hiding wordpress dashboard login error is very basic thing for keep away hackers.

how to hide wordpress login page error messages
how to hide wordpress login page error messages

Hiding wordpress dashboard login error is very basic thing for keep away hackers. Whenever you and any hackcer are trying to login using the correct username but with the wrong password, that will give you a message saying “Error: Incorrect Password.” hacker will got the clue that the username entered is in the system, and that they simply need to crack its password. Same with username also you will got following message.
“Error: Invalid username”
For avoiding this thing you just need to open your functions.php file and put the following code in that file

add_filter('login_errors', create_function('$a', "return null;"));

This hack will remove the WordPress error by displaying nothing when a login is incorrect.

 

How to add custom text in every wordpress post

wordpress tutorial, How to add custom text in every wordpress post. There is always common content we want put in every post. using following function we can add the custom text in every wordpress post.

How to add custom text in every wordpress post

just open your functions.php file from wordpress theme folder and put the following code in that file.


function mytext($content)
{
return "The addtional content goes here: ".$content;
}
add_filter('the_content', 'mytext');

How to add custom text in every wordpress post
How to add custom text in every wordpress post