Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 04-16-2014, 11:15 PM   #1
areeshanoor2020
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 198
Php code Customize

Hello Every One,
I have a problem with my website category and author.
these are Nofollow. I want to add categories and Author dofollow. Please customize below code. Thanks in Advance.

/* Nofollow to category links
/*-----------------------------------------------------------------------------------*/
add_filter( 'the_category', 'add_nofollow_cat' );
function add_nofollow_cat( $text ) {
$text = str_replace('rel="category tag"', 'rel="nofollow"', $text); return $text;
}

/*-----------------------------------------------------------------------------------*/
/* nofollow post author link
/*-----------------------------------------------------------------------------------*/
add_filter('the_author_posts_link', 'mts_nofollow_the_author_posts_link');
function mts_nofollow_the_author_posts_link ($link) {
return str_replace('<a href=', '<a rel="nofollow" href=',$link);
}
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
areeshanoor2020 is offline   Reply With Quote

Old 04-23-2014, 12:15 AM   #2
guiltyCrown
Registered User
 
Join Date: Apr 2014
Location: UK
Posts: 15
Quote:
/* Nofollow to category links
/*-----------------------------------------------------------------------------------*/
add_filter( 'the_category', 'add_nofollow_cat' );
function add_nofollow_cat( $text ) {
$text = str_replace('rel="category tag"', 'rel="dofollow"', $text); return $text;
}

/*-----------------------------------------------------------------------------------*/
/* nofollow post author link
/*-----------------------------------------------------------------------------------*/
add_filter('the_author_posts_link', 'mts_nofollow_the_author_posts_link');
function mts_nofollow_the_author_posts_link ($link) {
return str_replace('<a href=', '<a rel="dofollow" href=',$link);
}
Like this? or I think you can just return $link in the lsat one and return $text in the first one.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
guiltyCrown is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importance of Php Development for Web Development tech.biztech Programming General 35 11-22-2019 12:37 AM
How to submit html code with php? eigeehte Programming General 2 05-26-2014 09:00 PM
Outputting PHP code from MySQL ncjbhd PHP / mySQL 7 03-21-2014 05:37 AM
attractive THANKGIVING offers with a coupon code KVChosting The Market 0 11-16-2012 06:21 AM
is it possible to make an php file trough a php code ncjbhd PHP / mySQL 0 09-21-2011 11:49 PM


All times are GMT -7. The time now is 11:06 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.