Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   How to carry a query string in wordpress post. (http://www.greenguysboard.com/board/showthread.php?t=52247)

hashbury 2009-04-03 03:38 PM

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?

Beaver Bob 2009-04-03 05:49 PM

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.

hashbury 2009-04-04 01:38 AM

Quote:

Originally Posted by Beaver Bob (Post 446907)
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

hashbury 2009-04-06 04:57 PM

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?

Beaver Bob 2009-04-07 06:57 PM

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:


Hope that gives you an idea.

hashbury 2009-04-08 04:15 PM

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?

Beaver Bob 2009-04-08 06:13 PM

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.

hashbury 2009-04-09 02:09 PM

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:


Code:


Is this the right code? Ive tried adding my code like this
Code:


Code:


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|banghead|. Any suggestions?

Beaver Bob 2009-04-09 02:17 PM

try this:

Code:

?>
you just need to carry $aff_link_id in your query string

hashbury 2009-04-09 02:46 PM

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

Beaver Bob 2009-04-10 11:51 AM

hope it works out for you!


All times are GMT -4. The time now is 04:25 PM.

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