Support » Plugin: WPAdverts - Classifieds Plugin » Redirection of Adverst_list is not correct

  • Resolved legentlemanfr


    Hi Greg,

    I am developing a website with 2 languages thank to WPML plugin and I have a problem in the use of [adverts_list] shortcode with “redirect_to” option.
    Here is the configuration :
    Page A (french)
    [adverts_list “redirect_to”=French_Results_Page” show_results=”0″]

    Page B (english)
    [adverts_list “redirect_to”=English_Results_Page” show_results=”0″]

    The problem is that Page B is redirected towards French_Result_Page with a list of ads in the french version.

    Note that without redirection, the shortcode returns correctly the list of ads in the good version.

    Any idea ?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Greg Winiarski


    please note that your redirect_to has quote characters in incorrect places it should be

    [adverts_list redirect_to="English_Results_Page" show_results="0″]

    also i assume that in place of English_Results_Page you are entering either actual ID of a page you want to redirect to or an absolute URL of a page (starting with http:// or https://) you would like to redirect users to?

    If this will not help it would be best if you could paste here a link to a page where you are having this problem.

    Hello Greg,

    Sorry, wrong copy/paste for the quote characters. My shortcodes are well formatted.
    Here are the two links:
    <b>French page :</b>
    with shortcode [adverts_list redirect_to=”; show_results=”0″ show_pagination=”0″ switch_views=”0″]

    <b>English version of the same page (synchronized with WPML) :</b>
    with shortcode [adverts_list redirect_to=”; show_results=”0″ show_pagination=”0″ switch_views=”0″]

    In the english page, the action field in the search <form> reflects well the redirect_to parameter of the shortcode.
    By examining, it seems that page is loaded. As the language argument ?lang=en is missing in the URL, a 301 HTTP redirect error is generated.

    Thanks again for your support.


    Plugin Author Greg Winiarski


    Hi, note that this has more to do with how the HTML forms are being sent rather than with WPAdverts or WPML.

    The search form is being sent using GET method, on submit your form inputs are being appended to the query string, and the GET params you have in ‘action’ attribute are removed, so in your case to get the desired result in your form you would need to have a hidden input with lang param

    <input type="hidden" name="lang" value="en" />

    or the redirect URL should have the lang attribute in the URL like this, for example, although i am not sure if it is possible to setup WPML like that.


    I’ve just add a condition on ICL_LANGUAGE_CODE and your new input in /templates/list.php and it works perfectly.

    Thanks Greg.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirection of Adverst_list is not correct’ is closed to new replies.