Skip to content

Instantly share code, notes, and snippets.

@gfazioli
Last active December 18, 2015 01:09
Show Gist options
  • Save gfazioli/5701714 to your computer and use it in GitHub Desktop.
Save gfazioli/5701714 to your computer and use it in GitHub Desktop.
Bannerize HTML markup
[wpx_bannerize random="1"]
[wpx_bannerize random="1" category="56"]
[wpx_bannerize random="1" category="sidebar-blog"]
<?php
// Display all banners from category "sidebar" in random order
if( function_exists( 'wpx_bannerize' ) ) {
wpx_bannerize( array( 'random' => true, 'category' => 'sidebar' ) );
}
// Display one banner from category "sidebar" in random order
if( function_exists( 'wpx_bannerize' ) ) {
wpx_bannerize( array( 'random' => true, 'numbers' => 1, 'category' => 'sidebar' ) );
}
<?php
$defaults = array(
'random' => false,
'numbers' => 10,
'category' => '',
'order' => 'ASC',
'orderby' => 'menu_order',
);
<!-- Main bannerize container -->
<div class="wpx_bannerize">
<!-- Single banner container -->
<div class="wpx_bannerize_banner_box wpx_bannerize_banner_mime_imagepng" id="banner-id">
<a href="http://beta.wpxtre.me" target="_blank">
<img title="Banner description"
alt="Banner description"
src="/image.png" border="0" />
</a>
</div>
<!-- Single banner container -->
<div class="wpx_bannerize_banner_box wpx_bannerize_banner_mime_imagepng" id="banner-id">
<a href="http://beta.wpxtre.me" target="_blank">
<img title="Banner description"
alt="Banner description"
src="/image.png" border="0" />
</a>
</div>
<!-- Another banner... -->
</div>
<!-- wpx_bannerize -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment