Пример #1
0
function wyde_portfolio_nav($pages = 1, $range = 2)
{
    // Don't print empty markup if there's nowhere to navigate.
    $previous = is_attachment() ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
    $next = get_adjacent_post(false, '', false);
    if (!$next && !$previous) {
        return;
    }
    global $wyde_options;
    $home_button_url = '';
    if ($wyde_options['portfolio_home'] && !empty($wyde_options['portfolio_home_url'])) {
        $home_button_url = esc_url($wyde_options['portfolio_home_url']);
    }
    ?>

	<nav class="post-nav<?php 
    echo !empty($home_button_url) ? ' with-home' : '';
    ?>
 clear">
        <div class="prev-post">
        <?php 
    if ($previous) {
        $prev_thumbnail = wyde_get_post_thumbnail($previous->ID);
        previous_post_link('%link', '<i class="fa fa-angle-left"></i>');
        echo '<div class="post-link clear">';
        previous_post_link('<span class="thumb">%link</span>', $prev_thumbnail);
        previous_post_link('<div class="nav-text"><span>' . __('Previous Post', 'Vela') . '</span><h5>%link</h5></div>');
        echo '</div>';
    }
    ?>

        </div>
        <div class="next-post">
        <?php 
    if ($next) {
        $next_thumbnail = wyde_get_post_thumbnail($next->ID);
        next_post_link('%link', '<i class="fa fa-angle-right"></i>');
        echo '<div class="post-link clear">';
        next_post_link('<span class="thumb">%link</span>', $next_thumbnail);
        next_post_link('<div class="nav-text"><span>' . __('Next Post', 'Vela') . '</span><h5>%link</h5></div>');
        echo '</div>';
    }
    ?>

        </div>
        <?php 
    if (!empty($home_button_url)) {
        ?>

        <div class="nav-home">
            <a href="<?php 
        echo $home_button_url;
        ?>
"><i class="fa fa-th"></i></a>
        </div>
        <?php 
    }
    ?>

	</nav>
<?php 
}
Пример #2
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $number = !empty($instance['number']) ? absint(esc_attr($instance['number'])) : 5;
        if (!$number) {
            $number = 5;
        }
        $show_date = isset($instance['show_date']) ? $instance['show_date'] : true;
        $posts = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'has_password' => false, 'ignore_sticky_posts' => true, 'meta_key' => 'wyde_post_views_count', 'orderby' => 'meta_value_num', 'order' => 'DESC')));
        if ($posts->have_posts()) {
            echo $before_widget;
            if ($title) {
                echo $before_title . esc_html($title) . $after_title;
            }
            ?>

        <div class="vela-popular-posts">
		    <ul class="posts">
		    <?php 
            while ($posts->have_posts()) {
                $posts->the_post();
                ?>

			    <li>
                    <span class="thumb">
                    <?php 
                echo wyde_get_post_thumbnail(get_the_ID(), 'thumbnail', get_the_permalink());
                ?>

                    </span>
                    <p>
                        <a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>
			        <?php 
                if ($show_date) {
                    ?>

				        <span class="date"><?php 
                    echo get_the_date();
                    ?>
</span>
			        <?php 
                }
                ?>

                    </p>
			    </li>
		    <?php 
            }
            ?>

		    </ul>
        </div>
		<?php 
            echo $after_widget;
            ?>

<?php 
            wp_reset_postdata();
        }
    }
Пример #3
0
                    <div id="post-<?php 
            the_ID();
            ?>
" class="search-item clear">
                        <div class="item-header clear">
                            <?php 
            if ($wyde_options['search_show_image'] && (has_post_thumbnail() || get_post_type() == 'post')) {
                ?>

                            <span class="thumb">
                                <a href="<?php 
                echo esc_url(get_permalink());
                ?>
" target="_blank">
                                <?php 
                echo wyde_get_post_thumbnail(get_the_ID(), 'thumbnail');
                ?>

                                </a>
                            </span>
                            <?php 
            } else {
                ?>

                            <span class="type-icon">
                                <a href="<?php 
                echo esc_url(get_permalink());
                ?>
" target="_blank">
                                <?php 
                echo wyde_get_type_icon();