Example #1
0
function winsAjaxLoadCards()
{
    $page = $_POST['page'];
    $take = $_POST['take'];
    $query = new WP_Query(array('paged' => $page, 'posts_per_page' => $take));
    if ($query->have_posts()) {
        //aqui começa
        $i = 0;
        while ($query->have_posts()) {
            the_post();
            $i++;
            if ($i == 3) {
                echo "</ul><ul class='list-two'>";
            }
            if ($i == 5) {
                echo "<li class='post-mais-acessados'>";
                echo "<h1>mais lidos</h1>";
                //pvc_most_viewed_posts();
                echo "</li>";
            }
            if ($i == 5) {
                echo "</ul><ul class='list-three'>";
            }
            if ($i == 5) {
                echo "<li class='post-mais-comentados'>";
                echo "<h1>mais comentados</h1>";
                echo "<ul>";
                foreach (popularPosts(5) as $key => $p) {
                    $urlPost = get_permalink($p->ID);
                    $number = $key + 1;
                    if (strlen($p->post_title) <= 35) {
                        echo "<li><a href={$urlPost}>" . "<span class='number'>" . $number . "</span>" . "<span class='title'>" . $p->post_title . "</span></a></li>";
                    } else {
                        echo "<li><a href={$urlPost}>" . "<span class='number'>" . $number . "</span>" . "<span class='title'>" . substr($p->post_title, 0, 35) . "...</span></a></li>";
                    }
                }
                echo "</ul>";
                echo "</li>";
            }
            if ($i == 7) {
                echo "</ul><ul class='list-four'>";
            }
            if ($i == 8) {
                echo "</ul><ul class='list-three-col'>";
            }
            echo "<li>";
            get_template_part('content-sdm-card', get_post_format());
            echo "</li>";
        }
        //aqui termina
    } else {
        // no posts found
    }
}
Example #2
0
function load_data_request()
{
    if (isset($_REQUEST['currentpost'])) {
        $currentpost = $_REQUEST['currentpost'];
        $numpost = $_REQUEST['numpost'];
        $post_addr = $_REQUEST['post_addr'];
        $categoy_id = $_REQUEST['categoy_id'];
        $post_id = $_REQUEST['get_post_id'];
        if ($post_addr == 1) {
            $result = latestPosts($currentpost, $numpost);
        } elseif ($post_addr == 2) {
            $result = popularPosts($currentpost, $numpost);
        } elseif ($post_addr == 3) {
            $result = tagPosts($currentpost, $numpost, $categoy_id);
        } elseif ($post_addr == 4) {
            $result = stylelk_request_postpage($currentpost, $numpost, $post_id);
        } elseif ($_post_addr == 5) {
            categoryPosts($curentpost, $numpost, $tag_slug);
        }
        echo $result;
        die;
    }
}
Example #3
0
        wp_nav_menu(array('theme_location' => 'social', 'menu_class' => 'social-links-menu', 'depth' => 1, 'link_before' => '<span class="screen-reader-text">', 'link_after' => '</span>'));
        ?>
							</nav><!-- .social-navigation -->
						<?php 
    }
    ?>
					</div><!-- .site-header-menu -->
				<?php 
}
?>
			</div><!-- .site-header-main -->
			<div class="site-header-popular">
				<ul>
					<li class="first">+Acessados</li>
					<?php 
echo popularPosts(10);
?>
				</ul>
			</div>

			<?php 
if (get_header_image()) {
    ?>
				<?php 
    /**
     * Filter the default twentysixteen custom header sizes attribute.
     *
     * @since Twenty Sixteen 1.0
     *
     * @param string $custom_header_sizes sizes attribute
     * for Custom Header. Default '(max-width: 709px) 85vw,
Example #4
0
    the_title();
    ?>
</a></li>


						<?php 
}
?>

		



				<h5>Blog</h5>
					<?php 
echo popularPosts(5);
?>

					
			</div>
			<div class="col-md-3">
				<h5>Contact</h5>

			</div>
			<div class="col-md-3">
				<h5>Popular Products</h5>

				<div id="search" class="widget widget_search">
						<?php 
get_search_form();
?>
Example #5
0
            //pvc_most_viewed_posts();
            echo "</li>";
        }
        ?>

						<?php 
        if ($i == 5) {
            echo "</ul><ul class='list-three'>";
        }
        ?>
						<?php 
        if ($i == 5) {
            echo "<li class='post-mais-comentados'>";
            echo "<h1>mais comentados</h1>";
            echo "<ul>";
            foreach (popularPosts(5) as $key => $p) {
                $urlPost = get_permalink($p->ID);
                $number = $key + 1;
                if (strlen($p->post_title) <= 35) {
                    echo "<li><a href={$urlPost}>" . "<span class='number'>" . $number . "</span>" . "<span class='title'>" . $p->post_title . "</span></a></li>";
                } else {
                    echo "<li><a href={$urlPost}>" . "<span class='number'>" . $number . "</span>" . "<span class='title'>" . substr($p->post_title, 0, 35) . "...</span></a></li>";
                }
            }
            echo "</ul>";
            echo "</li>";
        }
        ?>

						<?php 
        if ($i == 7) {