Can I Create a Link in Wordpress that Passes a Value to The Loop?

1 replies
I'm trying to figure out a way that I can create a link that will pass two values to a category page. Those values will then be utilized in the loop to create the page.

Here's the idea... we've got a Music Review site that sports reviews of individual songs. I build main pages (and a post category) for each artist that has some intro text about the artist and then a second Loop displays the 7 most recent post excerpts (one post p/song). We'll use Metallica as our example artist.

Of course there are a lot of songs for each artist so at the bottom of the initial list I want a link that says: "More Metallica Song Reviews>>"

The link would take the visitor to another created page that would then use The Loop to produce a list of all the currently reviews songs (posts) that belong to Metallica.

Here's my idea on how to achieve this:

1) Create List Page Template - I'd create a page template that would use The Loop to display a list of all the posts in a specific category. It would need to:
  • Be able to "Catch" a value passed via the link URL to determine which category it would be displaying posts from
  • Be able to "Catch" a value passed via the link URL to determine how many posts the page would display.
These values would be dropped into the query_posts('cat=10&showposts=100') function to display the list of posts.

2) Create the Link from Main Artist Page -The underlying link code would be something like: http|//musicreviews.com/metallica-reviews&id=10&listcount=100

Somehow the link itself would pass the value to the Loop of the Category Display List page so it could do its thing.

Is this workable or am I grasping at straws here? It feels like it's either a 5 minute tweak or it's not workable at all because of the way Wordpress operates.

Any help would be greatly appreciated.
#create #link #loop #passes #wordpress
  • Profile picture of the author JagSEO
    I hope I know how to code but you have a nice idea. I think you can do it.
    Signature
    Hooked To Success -Personal development For People Who Wants Success.
    {{ DiscussionBoard.errors[2043387].message }}

Trending Topics