Trying to set up customer ULR in "Search Button"

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Trying to set up customer ULR in "Search Button"

This topic contains 5 replies, has 2 voices, and was last updated by Mike Graci Mike Graci 5 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #19560
    Mike Graci
    Mike Graci
    Participant

    I am trying to use customer ULR.

    I put code in functions.php—was expecting a drop down to appear with values.

    Perhaps validate my understanding–I was expecting to hit search icon and see a list of linkable options (value1, value2, value3, etc.)

    not clear to me –what to put in configuration (See atatched)

    Thanks

    <?php
    // — !! ONLY COPY THE CODE BELOW THIS LINE !! —
    // Use this to change the “redirect to url” parameter
    add_filter( ‘asp_redirect_url’, ‘asp_add_params_to_url’, 1, 10 );
    // Use this to change the “show more results url” parameter
    add_filter( ‘asp_show_more_url’, ‘asp_add_params_to_url’, 1, 10 );
    function asp_add_params_to_url( $url ) {
    // Array of param names and values
    $values = array(
    “param1” => “value1”,
    “param2” => “value2”,
    “param3” => “value3”
    );
    // Merge them together
    foreach ( $values as $k => $v )
    $url .= “&”.$k.”=”.$v;

    return $url;
    }
    view rawfunctions.php hosted wi

    Attachments:
    You must be logged in to view attached files.
    #19572
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    This custom code is not for this purpose, it will not change the layout of the search in any way. This is only to be used, when you want to add additional static parameters to the redirection URL (when the enter/magnifier is clicked), but it will not change anything within the search bar.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #19578
    Mike Graci
    Mike Graci
    Participant

    Thanks Ernest—perhaps you can weigh in here.

    Attached is the search box I have…what I am trying to get to is like the other screens shots (this is off of LISTABLE Theme). Is there anyway I can add a triangle marker to “your” search box and then “pre-populate” with a given set of URSL—like one in listable?

    Will take any advice you can offer…is there any similar capability in your plugin….and/or is it a realistic customization?

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #19624
    Mike Graci
    Mike Graci
    Participant
    You cannot access this content.
    #19625
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Mike,

    Sorry about the late response. I read your ticket last night, I forgot to answer.
    My honest conclusion is, that his would be very difficult to achieve without major customizations. I have looked up the filters, to maybe somehow use the built-in ‘chosen’ script to achieve something similar, (I have looked trough their whole API) but it does not have the capabilities either. The only option is a complete customization in my opinion.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #19626
    Mike Graci
    Mike Graci
    Participant
    You cannot access this content.
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.