Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How do I nofollow this type of PHP code?
Old 05-28-2009, 04:29 AM How do I nofollow this type of PHP code?
Junior Talker

Posts: 4
Name: Sebastian
Trades: 0
Quote:
<?php
function get_main_menu($pre = '')
{
$output = '<ul>';
$args = 'title_li=&echo=0';
$defaults = array(
'depth' => 0,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '',
'title_li' => __('Pages'),
'echo' => 1,
'authors' => '',
'sort_column' => 'ID'
);
$r = wp_parse_args( $args, $defaults );
$pages = get_pages($r);
$output .= wp_list_pages('title_li=&echo=0&sort_column=ID&inc lude=2,3,4,5,6,7');
//$output = str_replace('<ul><li', '<ul><li id="li-first"', $output);

$output = str_replace('>' . $pages[0]->post_title . '<', '>' . '<span>HOME</span>' . '<', $output);
$output = str_replace('>' . $pages[1]->post_title . '<', '>' . '<span>BLOG</span>' . '<', $output);
$output = str_replace('>' . $pages[2]->post_title . '<', '>' . '<span>SEARCH MLS</span>' . '<', $output);
$output = str_replace('>' . 'Buying Tucson Homes' . '<', '>' . '<span>BUY</span>' . '<', $output);
$output = str_replace('>' . 'Selling Tucson Homes' . '<', '>' . '<span>SELL</span>' . '<', $output);
$output = str_replace('>' . 'Tucson Resources' . '<', '>' . '<span>TUCSON RESOURCES</span>' . '<', $output);


$output .= '</ul>';

//$output = str_replace(get_permalink(4), 'http://mls.tredaily.com' , $output);



return $output;
}
?>
Hey Folks,

I'm not the savviest when it comes to tech coding so I have to ask for your help. I'm only used to applying nofollow to <a href=> tags, and I have no idea on how to implement it on the code above.

I would like to implement nofollow onto these lines only:

$output = str_replace('>' . 'Buying Tucson Homes' . '<', '>' . '<span>BUY</span>' . '<', $output);

$output = str_replace('>' . 'Selling Tucson Homes' . '<', '>' . '<span>SELL</span>' . '<', $output);

$output = str_replace('>' . 'Tucson Resources' . '<', '>' . '<span>TUCSON RESOURCES</span>' . '<', $output);

How do I go about doing that?


---

And another thing that I need nofollow-ed is this:

<?php mdv_recent_posts(2, '<div class="color-block">', '</div>', true, 0, false, false)?>

These are the two most recent posts on my blog and I'd like to have them nofollowed.


---

I tried searching Google for nofollow-ing outputs but I kept coming across sites that are talking about Drupal. I tried putting the pieces together with the listed examples, but after an hour of trying I believe I'm better off getting help from a professional.

I thank you for your help in advance.

-Seb
sebastiankim9 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-28-2009, 08:47 AM Re: How do I nofollow this type of PHP code?
EdB
Skilled Talker

Posts: 79
Name: Ed Barnett
Trades: 0
I've not come across "nofollow" before. What is it?
__________________

Please login or register to view this content. Registration is FREE
EdB is offline
Reply With Quote
View Public Profile Visit EdB's homepage!
 
Old 05-28-2009, 03:17 PM Re: How do I nofollow this type of PHP code?
Junior Talker

Posts: 4
Name: Sebastian
Trades: 0
Nofollow is used to page sculpt, to tell S.E. spiders which pages should not be given link juice and such.

Pages that you don't need to have ranked in the search engines, you nofollow them.
sebastiankim9 is offline
Reply With Quote
View Public Profile
 
Old 05-28-2009, 06:16 PM Re: How do I nofollow this type of PHP code?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
You can't do it in this code. The links are being created by the wp_list_pages so you'd need to rewrite that WordPress function. However that's not a good idea so you can try a plugin like Page Lists Plus instead.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-28-2009, 06:24 PM Re: How do I nofollow this type of PHP code?
Junior Talker

Posts: 4
Name: Sebastian
Trades: 0
vangogh,

thank you so much for your help. this is the answer that i've been looking for!

but with the two most recent posts that appear on my homepage, do you know the way to nofollow these?

<?php mdv_recent_posts(2, '<div class="color-block">', '</div>', true, 0, false, false)?>

i don't want to be sending link juice to these recent posts from my homepage.

any tips?

Last edited by sebastiankim9; 05-28-2009 at 06:26 PM..
sebastiankim9 is offline
Reply With Quote
View Public Profile
 
Old 05-28-2009, 06:42 PM Re: How do I nofollow this type of PHP code?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Is that a recent posts plugin? The line of code you posted doesn't look like it does anything with the links. It would have to be someplace else. However if you change the code through the plugin you're likely going to add nofollow to every recent post.

Is there a reason why you want to add nofollow to the links? I wouldn't worry too much about sending link juice to posts from your home page. It's too easy to micromanage when you probably don't need to be so concerned.

If you do want to add nofollow I'd search for some plugins. There's likely one out there that will do what you want.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-28-2009, 07:45 PM Re: How do I nofollow this type of PHP code?
Junior Talker

Posts: 4
Name: Sebastian
Trades: 0
Hey Van Gogh,

yes, it's a recent posts plug in. i should've realized that. i'll find a way to work that.

but i just want to micromanage now because that's the one of the few resorts I have left. I have a website with major links coming into me, and i'm still being beat out by stupid websites that' have been grandfathered in from the past. all they have are link farm links, and they still remain in the top of google.

it's my last resort... just tryna keep all the power in the home field..
sebastiankim9 is offline
Reply With Quote
View Public Profile
 
Old 05-29-2009, 05:32 PM Re: How do I nofollow this type of PHP code?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I guess if you've tried other things and want to give PR sculpting a shot there's nothing wrong with. Just be careful, since you can do some damage.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to How do I nofollow this type of PHP code?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.56356 seconds with 12 queries