コード例 #1
0
ファイル: rating.php プロジェクト: niko-lgdcom/archives
function polldaddy_show_rating($content)
{
    if (!is_feed() && !is_attachment()) {
        if (is_single() || is_page() || is_home()) {
            $html = polldaddy_get_rating_html('check-options');
            if (!empty($html)) {
                $rating_pos = 0;
                if (is_page()) {
                    $rating_pos = (int) get_option('pd-rating-pages-pos');
                } else {
                    if (is_home()) {
                        $rating_pos = (int) get_option('pd-rating-posts-index-pos');
                    } else {
                        $rating_pos = (int) get_option('pd-rating-posts-pos');
                    }
                }
                if ($rating_pos == 0) {
                    $content = $html . $content;
                } else {
                    $content .= $html;
                }
            }
        }
    }
    return $content;
}
コード例 #2
0
ファイル: rating.php プロジェクト: KimcoBlogSC/Blog
function polldaddy_show_rating($content)
{
    global $wp_current_filter;
    if (!in_array('get_the_excerpt', (array) $wp_current_filter)) {
        if (!is_feed() && !is_attachment()) {
            if (is_single() || is_page() || is_home() || is_archive() || is_search() || is_category()) {
                $html = polldaddy_get_rating_html('check-options');
                if (!empty($html)) {
                    $rating_pos = 0;
                    if (is_page()) {
                        $rating_pos = (int) get_option('pd-rating-pages-pos');
                    } elseif (is_home() || is_archive() || is_search() || is_category()) {
                        $rating_pos = (int) get_option('pd-rating-posts-index-pos');
                    } else {
                        $rating_pos = (int) get_option('pd-rating-posts-pos');
                    }
                    if ($rating_pos == 0) {
                        $content = $html . '<br/>' . $content;
                    } else {
                        $content .= $html;
                    }
                }
            }
        }
    }
    return $content;
}
コード例 #3
0
ファイル: recentposts.php プロジェクト: MBerguer/wp-demo
 function widget($args, $instance)
 {
     extract($args);
     /* User-selected settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $category = $instance['category'];
     $show_count = $instance['show_count'];
     $show_date = $instance['show_date'] ? true : false;
     $show_rating = $instance['show_rating'] ? true : false;
     $show_thumb = $instance['show_thumb'] ? true : false;
     $show_excerpt = $instance['show_excerpt'] ? true : false;
     $excerpt_length = $instance['excerpt_length'];
     $show_title = $instance['hide_title'] ? false : true;
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Title of widget (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<ul class="feature-posts-list">';
     $query_opts = apply_filters('wpzoom_query', array('posts_per_page' => $show_count, 'post_type' => 'post'));
     if ($category) {
         $query_opts['cat'] = $category;
     }
     query_posts($query_opts);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             echo '<li>';
             if ($show_thumb) {
                 get_the_image(array('size' => 'recent-widget', 'width' => $instance['thumb_width'], 'height' => $instance['thumb_height']));
             }
             if ($show_title) {
                 echo '<a href="' . get_permalink() . '">' . get_the_title() . '</a> <br />';
             }
             if ($show_rating && function_exists('polldaddy_get_rating_html')) {
                 echo '<div class="rating">' . polldaddy_get_rating_html() . '</div>';
             }
             if ($show_date) {
                 echo '<small>' . get_the_date() . '</small> <br />';
             }
             if ($show_excerpt) {
                 $the_excerpt = get_the_excerpt();
                 // cut to character limit
                 $the_excerpt = substr($the_excerpt, 0, $excerpt_length);
                 // cut to last space
                 $the_excerpt = substr($the_excerpt, 0, strrpos($the_excerpt, ' '));
                 echo '<span class="post-excerpt">' . $the_excerpt . '</span>';
             }
             echo '<div class="clear"></div></li>';
         }
     } else {
     }
     //Reset query_posts
     wp_reset_query();
     echo '</ul><div class="clear"></div>';
     /* After widget (defined by themes). */
     echo $after_widget;
 }
コード例 #4
0
function pickle_indexloop()
{
    //Use php to create a new loop.
    if (is_home() & !is_paged()) {
        //NOTE: this is where angel created divs to hold her loop content and also category header,
        //because she is adding her function as an action hook below_container
        //but in my case, i'm filtering the thematic_indexloop, so no html is necessary here for me.
        //Create a query to use with a loop. Big thanks to Allan Cole - www.allancole.com - for sharing his code!
        // First, grab any global settings you may need for your loop.
        global $paged, $more, $post;
        //the post variable is for calling meta data created with custom write panels
        $more = 0;
        // Second, create a new temporary Variable for your query.
        // $feature_pickle_query is the Variable used in this example query.
        // If you run any new Queries, change the variable to something else more specific ie: $feature_wp_query.
        $temp = $feature_pickle_query;
        // Next, set your new Variable to NULL so it's empty.
        $feature_pickle_query = null;
        // Then, turn your variable int the WP_Query() function.
        $feature_pickle_query = new WP_Query();
        // Set you're query parameters. Need more Parameters?: http://codex.wordpress.org/Template_Tags/query_posts
        $feature_pickle_query->query(array('category_name' => 'featured-pickle', 'showposts' => '1'));
        // Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)
        // Or just use the thematic action.
        thematic_navigation_above();
        // While posts exists in the Query, display them.
        while ($feature_pickle_query->have_posts()) {
            $feature_pickle_query->the_post();
            // Start the looped content here.
            ?>
  
        <div id="post-<?php 
            the_ID();
            ?>
" class="<?php 
            thematic_post_class();
            ?>
">
                
            <div id="post-content">       
                <?php 
            the_post_thumbnail();
            // we just called for the thumbnail
            ?>
                <div class="entry-content">
                     <!-- Display the Title as a link to the Post's permalink. -->
                    <h2 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
                    <?php 
            if (get_post_meta($post->ID, 'pickle-maker')) {
                ?>
<p class="maker_name"><?php 
                echo get_post_meta($post->ID, 'pickle-maker', $single = true);
                ?>
</p><?php 
            }
            ?>
                    <?php 
            echo polldaddy_get_rating_html();
            ?>
                    <?php 
            the_content('Read more...');
            ?>
                </div>
            </div>    
        </div><?php 
            //#featured
        }
        //This is how to end a loop
    }
    // Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)
    // Or us the thematic action.
    thematic_navigation_below();
    // End the Query and set it back to temporary so that it doesn't interfere with other queries.
    $feature_pickle_query = null;
    $feature_pickle_query = $temp;
    // Thats it! End of the feature pickle query.
    //------------------------Now we want to create another loop that shows 6 posts as a gallery below the feature pickle post.
    //------------------------Remember we are still within the same funtion, which is ultimately replacing the index loop.
    //Use php to create a new loop.
    if (is_home() & !is_paged()) {
        // Second, create a new temporary Variable for your query.
        // $front_page_gallery is the Variable used in this example query.
        // If you run any new Queries, change the variable to something else more specific ie: $feature_wp_query.
        $temp = $front_page_gallery;
        // Next, set your new Variable to NULL so it's empty.
        $front_page_gallery = null;
        // Then, turn your variable int the WP_Query() function.
        $front_page_gallery = new WP_Query();
        // Set you're query parameters. Need more Parameters?: http://codex.wordpress.org/Template_Tags/query_posts
        $front_page_gallery->query(array('category_name' => 'front-page-gallery', 'showposts' => '6'));
        // Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)
        // Or just use the thematic action.
        thematic_navigation_above();
        // While posts exists in the Query, display them.
        while ($front_page_gallery->have_posts()) {
            $front_page_gallery->the_post();
            // Start the looped content here.
            ?>
            <div class="gallery_thumb_container">
                <div id="post-<?php 
            the_ID();
            ?>
" class="<?php 
            thematic_post_class();
            ?>
">
                    <?php 
            the_post_thumbnail();
            // we just called for the thumbnail
            ?>
                    <div class="gallery-content">
                        <!-- Display the Title as a link to the Post's permalink. -->
                        <h2 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
                        <?php 
            if (get_post_meta($post->ID, 'pickle-maker')) {
                ?>
<p class="maker_name"><?php 
                echo get_post_meta($post->ID, 'pickle-maker', $single = true);
                ?>
</p><?php 
            }
            ?>
                        <?php 
            echo polldaddy_get_rating_html();
            ?>
                    </div>
                </div>
            </div>
<?php 
        }
        //This is how to end a loop
    }
    // Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)
    // Or us the thematic action.
    thematic_navigation_below();
    // End the Query and set it back to temporary so that it doesn't interfere with other queries.
    $front_page_gallery = null;
    $front_page_gallery = $temp;
    ?>

<?php 
    // Thats it! End of front page gallery.
}
コード例 #5
0
ファイル: sidebar.php プロジェクト: MBerguer/wp-demo
<div id="sidebar">

	<?php 
if (is_single() && get_post_meta(get_the_ID(), 'wpzoom_is_recipe', true)) {
    ?>
<div id="single-recipe" class="widget widget-recipe">
			<?php 
    $fields = get_fields();
    if (!empty($fields)) {
        echo $fields;
    }
    if (function_exists('polldaddy_get_rating_html')) {
        echo '<div class="rating"><h4>' . __('Rate', 'wpzoom') . '</h4> ' . polldaddy_get_rating_html() . '</div>';
    }
    ?>

			<div class="share">
 				<ul class="share-btn">
					<?php 
    global $post;
    $image = get_the_image(array('echo' => false, 'post_id' => $post->ID, 'format' => 'array'));
    ?>
					<li><iframe src="http://www.facebook.com/plugins/like.php?href=<?php 
    echo urlencode(get_permalink($post->ID));
    ?>
&amp;layout=standard&amp;show_faces=false&amp;width=260&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=28" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:260px; height:28px;" allowTransparency="true"></iframe></li>
					<li><a href="http://twitter.com/share" data-url="<?php 
    echo get_permalink($post->ID);
    ?>
" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li>
				 	<li><g:plusone size="medium"></g:plusone></li>
コード例 #6
0
ファイル: wpzoom-carousel.php プロジェクト: MBerguer/wp-demo
        ?>
					</div>
 
					<?php 
        the_title('<h4 class="title"><a href="' . get_permalink() . '" rel="bookmark" title="' . the_title_attribute('echo=0') . '">', '</a></h4>');
        ?>


					<?php 
        if (option::get('carousel_more_btn') == 'on' && function_exists('polldaddy_get_rating_html')) {
            ?>

						<div class="meta">
							<?php 
            if (option::get('carousel_rating') == 'on' && function_exists('polldaddy_get_rating_html')) {
                echo '<div class="rating">' . polldaddy_get_rating_html() . '</div>';
            }
            ?>

							<?php 
            if (option::get('carousel_more_btn') == 'on') {
                ?>
							<p class="buttons">

								<a href="<?php 
                the_permalink();
                ?>
" class="more"><?php 
                _e($is_recipe ? 'View Recipe' : 'Read More', 'wpzoom');
                ?>
</a>