Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Custom Query or ?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36456
    fectio1
    Member

    Hi,
    I need to display archive post from a specific category with a specific tag and would like to be able to get the permalink to it. Is this possible?

    Any direction or suggestions is appreciate or If further explaining is needed.

    #95900
    TheDoc
    Member

    Is this a specific post or a group of specific posts? If it’s a group, I would do something like this:

    Where ## is the id for your category and tag. Then I’d run the loop as normal. Make sure to use wp_reset_query after the loop.

    #95903
    fectio1
    Member

    It is a group and this will definitely get me started. Thanks. What if I want to link a string of text to this specific archive post group.

    basically, I have posts that belongs to a certain category and is tagged with a specific tag. I then have a page that has a link that needs to go to these post. Now, here is the catch.

    I have numerous pages. Each page has a a string of text that links to another specific tag and category. I was hoping to use archive.php or tag.php to display all of this and use the permalink to link the text within the page. I really dont want to create a new archive.php or tag.php for each custom query. This is probably confusing, but I could not figure out another way to break the site down.

    #95904
    TheDoc
    Member

    Aaahhhh… Hmmmm. Off the top of my head I can’t see a different way to do it (other than custom templates per query).

    Well, there’s one way that you can do it with a single template, but I’m sure it’ll be the same amount of work, but maybe a little less.

    Let’s say you had 5 different queries that have their own page. You could create a new template, name-here.php, and in that template you’re going to have five different loops. You could say,

    
    if( is_page('##') {
    // do loop #1
    }

    if( is_page('##') {
    // do loop #2
    }

    // etc. ?>

    You’d have to select this template from the template drop down of each of the pages. Not the most flexible solution, but maybe something to get your brain churning on it.

    #95907
    fectio1
    Member

    Awesome. I did not even think of using is page.. Much obliged!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.