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

Viewing 4 posts - 1 through 4 (of 4 total)
  • 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 4 posts - 1 through 4 (of 4 total)