• Resolved Razvan

    (@razvanmarin)


    Very nice & well done plugin!

    /advert-category/category-name – how to change ads columns number? In adverts page I have [adverts_categories show=”top” columns=”4″ show_count=”0″][adverts_list columns=”3″ posts_per_page=”9″] but when browsing a single category, are only 2 columns.

    From where can I change the default (1 week) expiration time for ads?

    https://www.ads-software.com/plugins/wpadverts/

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

    (@gwin)

    1. currently you would need to replace default adverts_the_content function

    add_action("init", "my_init", 20);
    function my_init() {
      remove_action("the_content", "adverts_the_content");
      add_action("the_content", "my_adverts_the_content");
    }
    function my_adverts_the_content($content) {
        global $wp_query;
    
        if (is_singular('advert') && in_the_loop() ) {
            ob_start();
            $post_id = get_the_ID();
            include apply_filters( "adverts_template_load", ADVERTS_PATH . 'templates/single.php' );
            $content = ob_get_clean();
        } elseif( is_tax( 'advert_category' ) && in_the_loop() ) {
            $content = shortcode_adverts_categories(array(
                "show" => "top",
                "columns" => 4,
                "show_count" => 0
            ));
            $content.= shortcode_adverts_list(array(
                "category" => $wp_query->get_queried_object_id()
                "columns" => 3,
                "posts_per_page" => 9
            ));
        }
    
        return $content;
    }

    2. you can change it in wp-admin / Classifieds / Options / Core panel.

    Thread Starter Razvan

    (@razvanmarin)

    Works! Thank You!

    hi

    which file should i edit if i want to do this?

    Plugin Author Greg Winiarski

    (@gwin)

    You can add it in your theme functions.php file or create a new plugin and paste it there.

    Hi greg,

    I tried adding this to my functions.php but i get this error”

    Parse error: syntax error, unexpected ‘”columns”‘ (T_CONSTANT_ENCAPSED_STRING), expecting ‘)’ on line 157

    Plugin Author Greg Winiarski

    (@gwin)

    The line

    "category" => $wp_query->get_queried_object_id()

    should be

    "category" => $wp_query->get_queried_object_id(),

    there is missing comma at the end of line.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Category page & default ads expiration time’ is closed to new replies.