function widget_polls($args) { global $in_pollsarchive; extract($args); $options = get_option('widget_polls'); $title = htmlspecialchars(stripslashes($options['title'])); if (function_exists('vote_poll') && !in_pollarchive()) { echo $before_widget . $before_title . $title . $after_title; if (intval(get_option('poll_currentpoll')) == -3) { $multiple_polls = explode(',', $options['multiple_polls']); foreach ($multiple_polls as $multiple_poll) { get_poll($multiple_poll); } } else { get_poll(); } display_polls_archive_link(); echo $after_widget; } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', esc_attr($instance['title'])); $poll_id = intval($instance['poll_id']); $display_pollarchive = intval($instance['display_pollarchive']); echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } get_poll($poll_id); if ($display_pollarchive) { display_polls_archive_link(); } echo $after_widget; }
<div id="conteudo-pagina-direito"> <h1>Publicidade</h1> <div id="banner"> <p><img src="<?php echo bloginfo('template_url'); ?> /images/banner.gif"></p> </div> <h1>Enquete</h1> <p><?php get_poll(); ?> </p> </div>
function kcsite_sidebar_poll() { if (function_exists('get_poll')) { $poll = get_poll(null, false); if ($poll != 'Šiuo metų aktyvių apklausų nėra' && $poll != '' && pll_current_language('slug') == 'lt') { //default template text if no polls ?> <aside class="widget wp-polls-embeded-widget"> <header> <h3 class="widget-title"><?php echo pll_e('Apklausa'); ?> </h3> </header> <div class="widget-content"> <?php echo $poll; ?> </div> </aside> <hr class="double-hr" /> <?php } } }
<!--<div class="new_add_polls"> <div class="Polls Grey"> <div class="Dotted box"><h2>Polls</h2></div> <div style="padding: 0pt 20px;"> ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd <?php get_poll(); ?> <?php var_dump(html_entity_decode(get_poll())); ?> </div> </div> </div>-->
/* * Template Name: Polls * To change this template, choose Tools | Templates * and open the template in the editor. */ get_header(); ?> <div class="margin-l18 flo width-600"> <div class="pad"> <?php if (function_exists('vote_poll') && !in_pollarchive()) { ?> <?php $related = $wpdb->get_results("\n SELECT pollq_id\n FROM {$wpdb->prefix}pollsq\n WHERE {$wpdb->prefix}pollsq.pollq_active = 1 \n LIMIT 10"); foreach ($related as $id) { get_poll($id->pollq_id); } ?> <?php } ?> </div> </div> <?php get_sidebar(); ?> </div> <?php get_footer();
function next_race() { $args = array('posts_per_page' => '1', 'post_status' => 'publish', 'post_type' => 'races', 'meta_key' => 'race_date', 'orderby' => 'meta_value_num', 'order' => 'ASC'); $query = new WP_Query($args); if ($query->have_posts()) { // Start looping over the query results. while ($query->have_posts()) { $query->the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); ?> <section class="next-event"> <article itemscope itemtype="http://schema.org/SportsEvent" class="next-race relative bgcover centre-text overflow" <?php if ($thumb_url) { ?> style="background-image:url(<?php echo $thumb_url[0]; ?> );" <?php } ?> > <div class="overlay"> <a href="<?php the_permalink(); ?> " class="block"> <h1 itemprop="name"><?php the_title(); ?> </h1> </a> <p> <span itemprop="startDate" content="#"> <?php echo date('jS', strtotime(get_field('start_date'))); ?> </span> – <span itemprop="endDate" content="#"> <?php echo date('jS F', strtotime(get_field('race_date'))); ?> </span> </p> <ul class="nobullet overflow race-info"> <li> <a href="#">Session Times</a> </li> <li> <?php if (get_field('circuit')) { $post = get_field('circuit'); //echo '<pre>'; print_r($post); echo '</pre>'; setup_postdata($post); ?> <a href="circuits/<?php echo $post->post_name; ?> ">Circuit Information</a> <?php wp_reset_postdata(); } ?> </li> <li> <a href="#">Facts & Figures</a> </li> </ul> </div> </article> <?php get_poll(2); ?> </section> <?php } } update_post_caches($posts); wp_reset_query(); }
function poll_shortcode($atts) { extract(shortcode_atts(array('id' => 0, 'type' => 'vote'), $atts)); if (!is_feed()) { if ($type == 'vote') { return get_poll($id, false); } elseif ($type == 'result') { return display_pollresult($id); } } else { return __('Note: There is a poll embedded within this post, please visit the site to participate in this post\'s poll.', 'wp-polls'); } }