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.
Eve
(@etransac)
hi
which file should i edit if i want to do this?
You can add it in your theme functions.php file or create a new plugin and paste it there.
Eve
(@etransac)
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
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.