Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2009-04-03, 03:38 PM   #1
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
How to carry a query string in wordpress post.

Im trying to figure out how to carry an affiliate id in posts through an rss feed in wordpress. Is there a string of code i can add on to my links in my post? Or is there a plugin that can manage this?
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-03, 05:49 PM   #2
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
I use runPHP
http://www.nosq.com/blog/2006/01/run...for-wordpress/

allows you to use PHP in your posts. There might be a better way, but this works for me.
Beaver Bob is offline   Reply With Quote
Old 2009-04-04, 01:38 AM   #3
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
Quote:
Originally Posted by Beaver Bob View Post
I use runPHP
http://www.nosq.com/blog/2006/01/run...for-wordpress/

allows you to use PHP in your posts. There might be a better way, but this works for me.
This is perfect Beaver Bob. I was already trying to use php code in the post but it was making the blog display wrong.
Thank You
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-06, 04:57 PM   #4
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
Anyone know how to carry a query string in the post titles or a way to include it in the permalinks? Im thinking maybe htaccess?
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-07, 06:57 PM   #5
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
You will most likely need to modify your theme.

Using the default kubrick theme, here is how I put the query string in the post title.. this is in the main index template, can you see where I made the modification?

Code:
<h2><a href="<?php the_permalink() ?><?php echo (isset($_GET['ref'])) ? '?ref='.$_GET['ref'] : ''; ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
Hope that gives you an idea.
Beaver Bob is offline   Reply With Quote
Old 2009-04-08, 04:15 PM   #6
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
That was perfect Beaver Bob. How do you do the rss feeds? Ive searched through all the files trying to find a href spot for my query string. Is this done a different way?
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-08, 06:13 PM   #7
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
you have to modify the feed-rss file in the wp-includes directory. Don't look for href but look for everywhere that displays a link.
Beaver Bob is offline   Reply With Quote
Old 2009-04-09, 02:09 PM   #8
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
Beaver Bob Thanks for your help so far. Im still having problems. In my feeds-rss file I found the two bits of code
Code:
<link><?php the_permalink_rss() ?></link>
Code:
<link><?php bloginfo_rss('url') . ?></link>
Is this the right code? Ive tried adding my code like this
Code:
<link><?php the_permalink_rss() . $_GET ['aff_link_id']; ?></link>
Code:
<link><?php bloginfo_rss('url') . $_GET ['aff_link_id']; ?></link>
I editted the code every way i could think of to get it to work.
So I thought i would go to feed.php and add my string to the the_permalink_rss function. This worked half ass, it will display my aff_link_id= but it will not display the actual affiliate number. I was going to try and use session variables to carry the affiliate number, but i cant seem to get it to work. Any suggestions?
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-09, 02:17 PM   #9
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
try this:

Code:
<link><?php bloginfo_rss('url') ?><?php echo (isset($_GET['aff_link_id'])) ? '/?aff_link_id='.$_GET['aff_link_id'] : ''; ?> ?></link>
you just need to carry $aff_link_id in your query string
Beaver Bob is offline   Reply With Quote
Old 2009-04-09, 02:46 PM   #10
hashbury
My name is hashbury not assburry
 
hashbury's Avatar
 
Join Date: Oct 2007
Location: Tampa
Posts: 1,125
I had to add it to the function
Code:
function the_permalink_rss() {
	echo apply_filters('the_permalink_rss', get_permalink()). '?aff_link_id=' .$_GET['aff_link_id'];
Thank so much for your help
__________________
Sig Goes Here!
hashbury is offline   Reply With Quote
Old 2009-04-10, 11:51 AM   #11
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
hope it works out for you!
Beaver Bob is offline   Reply With Quote
Reply


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

Forum Jump


All times are GMT -4. The time now is 07:50 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc