Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro where to find php code for form

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • JENNIFER LIN
    #38127

    Hi,
    I create a search form and see a short code like [searchandfilter id=”84″] . What if I want a php code so I can insert into file? Where do I find it?

    Ross Moderator
    #38227

    Hey Jennifer

    What are you trying to insert into the form?

    I generally wouldn’t recommend modifying teh plugin directly as you will lose your modifications on updates.

    That being said, if you must modify, then the displaying of the form is done over multiple files/classes.

    The main file to display the form is:

    search-filter-pro/public/includes/class-search-filter-display-shortcode.php which display the main part of the form.

    Then, for every field that is shown, there is another class search-filter-pro/public/includes/class-search-filter-generate-input.php

    Hope that helps.

    Thanks

    JENNIFER LIN
    #38682

    hi,

    no I am not trying to modify anything. What I mean is that I want to put the search in a place with a background image. Instead of putting a short code, I want to put php. for example, in formidable form, a short code like [frm id=14] can be also
    <?php echo FrmFormsController::get_form_shortcode( array( ‘id’ => 14, ‘title’ => false, ‘description’ => false ) ); ?>

    Whether I put short code or php, it’s the same.

    Ross Moderator
    #38805

    Hey Jennifer

    Then in this case you can do:

    <?php do_shortcode("[searchandfilter id='1']"); ?>

    🙂

    JENNIFER LIN
    #39352

    this php doesn’t work. I put it in homepage: http://www.legalpenguin.com. nothing shows up.

    i put it here and it’s there: https://www.legalpenguin.com/searchtest/

    Ross Moderator
    #39385

    Hi Jennifer

    Then I think it sounds like you are not positioning the shortcode in the correct place on your homepage.

    There should be absolutely no reason a shortcode like this should work in one place, and not another. Try other shortodes on your homepage and try to find the cause of the issue.

    Thanks

    JENNIFER LIN
    #39418

    the searchtest page shows because I simply put shortcode, not php. I inserted shortcode in the wpadmin ‘page’.

    the homepage doesnot show because I put <?php do_shortcode(“[searchandfilter id=’1′]”); ?> in front-page.php insetad of put shortcode in ‘page’ in wp-admin.

    if i put a php from formidable form like <?php echo FrmFormsController::get_form_shortcode( array( ‘id’ => 14, ‘title’ => false, ‘description’ => false ) ); ?>, it does shows ok.

    So my question is “is the php code correct?”

    Ross Moderator
    #39426

    Hey Jennifer

    Can you test that you are actually placing it in the correct place in your template – by putting in some plain text where it should be, and making sure this is displaying in the correct location?

    Also, sorry to ask, but are you updating the 1 in the shortcode to reflect the ID you require?

    <?php do_shortcode("[searchandfilter id='1']"); ?>

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.