Hello @zohrabt,
You should be able to display the price of classifieds using the same function above, but the custom field would be different.
Unfortunately, I don’t know which custom field the classifieds plugin is using for price, so you will need to contact the classifieds plugin’s developers and ask them that.
Once you have the custom field that you need, use this function below and replace the ‘custom_field_name’ with the actual custom field of the price:
function gmw_add_classified_price_to_results( $gmw, $post ) {
$price = get_post_meta( $post->ID, 'custom_field_name', true );
if ( $price ) {
echo 'Price: ' . $price;
}
}
add_action( 'gmw_posts_loop_before_get_directions', 'gmw_add_classified_price_to_results', 50, 2 );
I hope this helps.