Hi there,
and sorry for the delay.
Yes, you can but you have to write some lines of code.
First of all, which version of Bannerize are you using? WP Bannerize or WP Bannerize Pro?
Regular WP Bannerize, non-pro version. But it is the up to date version.
Hi,
sorry for the delay. So, you can:
Edit the functions.php file in your theme and add the following line:
add_shortcode( "agiovine_category", "agiovine_category" );
function agiovine_category( $atts = [], $content = null )
{
global $post;
$defaults = [
'post_type' => false,
'taxonomy' => false,
'category' => false,
];
$atts = shortcode_atts( $defaults, $atts, 'agiovine_category' );
if ( empty( $atts[ 'post_type' ] ) || empty( $atts[ 'taxonomy' ] ) || empty( $atts[ 'category' ] ) ) {
return $content;
}
if ( $post->post_type === $atts[ 'post_type' ] && has_term( $atts[ 'category' ], $atts[ 'taxonomy' ] ) ) {
return $content;
}
return "";
}
Then, in your post you’ll able to use:
[agiovine_category post_type="wp_kirk_cpt" taxonomy="wp_kirk_tax" category="enterprise"]
I'm visible only for the custom post type wp_kirk_cpt, taxonomy wp_kirk_tax
and category enterprise
[/agiovine_category]
The wp_kirk_cpt is the slug id of your Custom Post Type.
The wp_kirk_tax is the slug id of your Custom Post Taxonomy
The enterprise – for example – is the slug of category
Of course, you’ll use:
[agiovine_category post_type="wp_kirk_cpt" taxonomy="wp_kirk_tax" category="enterprise"]
[wp_bannerize]
[/agiovine_category]
In the above sample, wp_bannerize will be display only for that category.
Let me know if you need any help or information.
-
This reply was modified 9 years, 4 months ago by
gfazioli.