Forums Forums Search & Filter Pro How to show the currently selected title only

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #108195

    Is there a way to have a link on a blog post that goes to a S&F Pro form result?

    For example: A link to a category from a blog post that goes to the blog landing page but displays results only from that category? It would need to be dynamic too.

    Any help with this would be much appreciated.

    Trevor
    #108284

    Static yes, I am not sure how it could be dynamically made except in PHP in the template

    Anonymous
    #108335

    What I mean is, if a post is in a certain category can I put a snippet of PHP into the theme that will link to a page with a S&F Pro form that has that category selected and displays the results. It would be instead of having a separate category page.

    For a more solid example I can send you to the two pages in question.

    The form page:

    http://supersunhero.com/blog

    Example Single post :

    http://supersunhero.com/blog/signal-over-noise/

    Where it shows the category, I want to link to the blog page and have it show the results from relevant category.

    I hope that makes sense.

    Trevor
    #108369

    Would the link not be something like:

    http://mysite.com/blog/?_sft_category=signal-over-noise

    Is that what you mean?

    Anonymous
    #108449

    Hi,

    Yes exactly.

    I’ve made a snippet that is half static half dynamic which works fine for my needs!

    Thanks so much for your help.

    And for what it’s worth this is the code I used:

    <?php
    $categories = get_the_category();
    if ( ! empty( $categories ) ) {
      echo '<a href="/blog/?_sft_category=' . esc_html( $categories[0]->slug )  . '">' . esc_html( $categories[0]->name ) . '</a>';
    }?>
Viewing 5 posts - 1 through 5 (of 5 total)