Support » Plugin: WPAdverts - Classifieds Plugin » using filter adverts_load_template

  • Resolved alexpetrov

    (@alexpetrov)


    hi Greg, it’s me again. I have a question about using ‘filter adverts_load_template’. right I’ve done:

    add_action(“adverts_template_load”, “custom-add-payment”);
    function custom_list_template( /home/b/bod9nou/urist/public_html/wp-content/plugins/custom-template-wpadvers/custom-add-payment.php ) {
    1) the way to replace?
    $basename = add-payment.php( /home/b/bod9nou/urist/public_html/wp-content/plugins/wpadverts/addons/payments/templates/add-payment.php );
    2) the way to replace
    if( $basename == “add-payment.php” ) {
    return dirname( __FILE__ ) . “/add-payment.php”;
    } else {
    return /home/b/bod9nou/urist/public_html/wp-content/plugins/wpadverts/addons/payments/templates/add-payment.php;
    } 3)the path to the original?
    }

    I use a translator.
    link to the examples on the website doesn’t work.

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

    (@gwin)

    Hi, i am not sure, is this a code your are using on site? If so then it will not work as it is full of syntax errors.

    I am also not sure what you are trying to replace and where?

    Thread Starter alexpetrov

    (@alexpetrov)

    the link is not working on examples Using ‘adverts_load_template’ filter. please do I look

    Thread Starter alexpetrov

    (@alexpetrov)


    1) tpl to custom file?
    2)basename custom or original?
    3)do not understand where and what to change

    Plugin Author Greg Winiarski

    (@gwin)

    Using this snippet requires some PHP programming knowledge, the only part you need to change is #3 on your image.

    If you paste this snippet without any changes inside your theme functions.php then the “list.php” file template will NOT load from wp-content/plugins/wpadverts/templates/list.php but from wp-content/themes/your-theme-name/list.php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘using filter adverts_load_template’ is closed to new replies.