function column_shortcode($atts, $content = null) { extract(shortcode_atts(array('cols' => '3', 'position' => ''), $atts)); switch ($cols) { case 5: $classes[] = 'one-fifth'; break; case 4: $classes[] = 'one-fouth'; break; case 3: $classes[] = 'one-third'; break; case 2: $classes[] = 'one-half'; break; } switch ($position) { case 'first': case '1': $classes[] = 'first'; case 'last': $classes[] = 'last'; } return '<div class="' . implode(' ', $classes) . '">' . remove_wpautop($content) . '</div>'; }
function content_animator_shortcode($atts, $content = null, $code) { extract(shortcode_atts(array('delay' => '0', 'effect' => 'slide', 'direction' => 'left', 'align' => '', 'class' => '', 'easing' => 'linear', 'margin_top' => '', 'margin_left' => '', 'margin_right' => '', 'float' => '', 'id' => '', 'speed' => ''), $atts)); wp_enqueue_script("jquery-effects-fade", false, array('jquery-effects-core')); wp_enqueue_script("jquery-effects-slide", false, array('jquery-effect-core')); wp_deregister_script('content-animator'); wp_register_script('content-animator', get_template_directory_uri() . '/js/content.animator.min.js', null, true); wp_enqueue_script('content-animator'); ob_start(); $styling = $width_class = ''; if (!empty($margin_top)) { $styling = 'margin-top:' . $margin_top . 'px;'; } if (!empty($margin_left)) { $styling .= 'margin-left:' . $margin_left . 'px;'; } if (!empty($margin_right)) { $styling .= 'margin-right:' . $margin_right . 'px;'; } if (!empty($styling)) { $styling = 'style="' . $styling . '"'; } if ($float == 'yes') { $floatclass = 'float'; } else { $floatclass = ''; } $output = '<div id="anim-' . $id . '" class="animator-wrap ' . $width_class . ' ' . $floatclass . ' ' . $class . ' ' . $align . ' ' . 'direction-' . $direction . '" ' . $styling . ' data-animator-easing="' . $easing . '" data-animator-speed="' . $speed . '" data-animator-effect="' . $effect . '" data-animator-direction="' . $direction . '" data-animator-delay="' . $delay . '">'; $output .= remove_wpautop($content); $output .= '</div>'; echo $output; $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
function shortcode_list_posts($atts, $content = null) { extract(shortcode_atts(array('posts_per_page' => -1, 'cat' => '', 'tag' => '', 'order' => '', 'order_by' => ''), $atts)); $args = array('post_type' => 'post', 'posts_per_page' => $posts_per_page, 'post_status' => 'publish'); if (!empty($cat)) { $cat = split(',', str_replace(" ", "", $cat)); $args['category__and'] = $cat; } if (!empty($tag)) { $tag = split(',', str_replace(" ", "", $tag)); $args['tag__in'] = $tag; } if ($order) { $args['order'] = $order; } if ($order_by) { $args['orderby'] = $order_by; } $my_query = new WP_Query(); $my_query->query($args); $content = '<ul class="post-list" >'; while ($my_query->have_posts()) { $my_query->the_post(); $author = get_the_author_meta('display_name'); $author_url = get_author_posts_url(get_the_author_meta('ID')); $content .= '<li><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a> <span>- by <a href="' . $author_url . '" title="' . $author . '">' . $author . '</a> on ' . get_the_time('F j, Y') . '</span></li>' . "\n"; } $content .= '</ul><!-- end .post-list -->'; //wp_reset_query(); return remove_wpautop($content); }
function toggle($atts, $content) { extract(shortcode_atts(array('title' => ''), $atts)); $new_content = remove_wpautop($content); return '<div class="toggle-content expanding"> <div class="expand-button"><p>' . $title . '</p></div> <div class="expand">' . $new_content . '</div> </div>'; }
function twothirds($atts, $content) { extract(shortcode_atts(array('end' => ''), $atts)); $new_content = remove_wpautop($content); if ($end == 'true') { return '<div class="two-thirds end">' . $new_content . '</div>'; } else { return '<div class="two-thirds">' . $new_content . '</div>'; } }
function tt_event_column_right($atts, $content) { return '<div class="tt_event_column_right">' . remove_wpautop($content) . '</div>'; }
?> <div class="row"> <div class="col-md-8"> <article <?php post_class(); ?> > <div class="blog_post"> <?php the_post_thumbnail("event-post-thumb", array("alt" => get_the_title(), "title" => "")); ?> <?php if (have_posts()) { while (have_posts()) { the_post(); echo remove_wpautop(get_the_content()); } } ?> </div> </article> </div> <?php if (is_active_sidebar('sidebar-event')) { ?> <div class="col-md-4"> <div id="primary-sidebar" class="primary-sidebar widget-area sidebar"> <?php dynamic_sidebar('sidebar-event'); ?> </div>
function warning($atts, $content) { $new_content = remove_wpautop($content); return '<div class="warning_box">' . $new_content . '</div>'; }
/** * Shortcode to display a 4/5 column * * @since 0.9 * @version 2.0.0 * * @link Codex reference: shortcode_atts() * @link PHP reference: extract() * * @uses remove_wpautop() Defined in this file * @uses clearfloat() Defined in this file * * @param array $atts * @param string $content * * @return string */ function four_fifths_arconix_shortcode($atts, $content = null) { extract(shortcode_atts(array('last' => ''), normalize_empty_atts($atts))); $last ? $last = ' arconix-column-last' : ($last = ''); $return = '<div class="arconix-column-four-fifths' . $last . '">' . remove_wpautop($content) . '</div>'; $float = clearfloat($last); $return .= $float; return $return; }
function all_portfolio_items($atts) { global $portfolio, $post, $msd_portfolio_url; extract(shortcode_atts(array('cols' => 4), $atts)); $ID = 'all'; $items = $this->get_portfolio_items(array()); $i = 1; foreach ($items as $item) { $portfolio->the_meta($item->ID); $youtube = $portfolio->get_the_value('youtube'); $featured_image = $this->get_portfolio_grid_image($item); $content = $this->get_portfolio_content($item); $menu .= '<li class="tab-' . $item->post_name . '" style="background:url(' . $featured_image . ') no-repeat center center;background-size:cover;"><a href="#' . $item->post_name . '" data-toggle="modal">' . $item->post_title . '</a><a href="' . get_edit_post_link($item->ID) . '"><i class="icon-edit"></i></a>' . get_the_term_list($item->ID, 'msd_portfolio_tag') . '</li>' . "\n"; $j = 0; foreach ($content as $piece) { if (!empty($piece['image'])) { $key = $j == 0 ? '' : '-' . $j; $slides .= '<div id="' . $item->post_name . $key . '" class="item div-' . $item->post_name . $key . $active . '"> <div class="portfolio-piece">' . remove_wpautop(apply_filters('the_content', $piece['image'])) . '</div> <h3 class="portfolio-piece-title">' . $piece['title'] . '</h3> <div class="entry-content">' . remove_wpautop(apply_filters('the_content', $piece['description'])) . '</div> </div>'; $j++; } } $i++; } return "\n" . '<div class="portfolio-grid portfolio-' . $ID . '">' . "\n" . '<ul class="nav">' . "\n" . $menu . "\n" . '</ul>' . "\n" . '<div class="content">' . "\n" . $slides . "\n" . '</div>' . "\n" . $nav . "\n" . '</div>'; }
function msdlab_landing_page_callout($atts, $content = null) { $ret = '<div class="callout">' . remove_wpautop($content) . '</div>'; return $ret; }
function frusion_slide($atts, $content = null, $code) { extract(shortcode_atts(array('width' => '600', 'height' => '400'), $atts)); return '<div id="content_slider"><div style="width:' . $width . 'px;height:' . $height . 'px;" class="content_slider">' . remove_wpautop($content) . '</div></div>'; }
function imediapixel_col_34_inner_last($atts, $content = null) { return '<div class="col_34_inner last">' . remove_wpautop($content) . '</div>'; }
function caden_onesixthlast($atts, $content = null) { return '<div class="one_sixth last">' . remove_wpautop($content) . '</div>'; }
function quote_left($atts, $content) { $new_content = remove_wpautop($content); return '<span class="quote_left">' . $new_content . '</span>'; }