/** * call response ajax */ function update_view() { $action = $_POST['action']; $id = $_POST['id']; switch ($action) { case 'update_view': setPostViews($id, 'view-news'); break; } exit; }
<div class="row top"> <div class="small-12 medium-8 columns" role="main"> <?php //if( is_singular( array('ercs','whitepapers','webinars','special-reports') )) { get_template_part('parts/flags'); ?> <?php do_action('foundationpress_before_content'); ?> <?php while (have_posts()) { the_post(); setPostViews(get_the_ID()); ?> <?php $astused = get_post_meta($id, '_wp_esmad_template', true); $oldtemplate = get_post_meta($id, '_wp_post_template', true); if (!$oldtemplate == 'default' and strlen($oldtemplate > 4)) { echo '<!-- old template' . $oldtemplate . ' -->'; //using old template //require_once( 'library/boxes.php' ); include 'single-coa.php'; } else { ?> <article <?php post_class();
<?php /* Single Post Template: Review */ /** * The template for displaying review single posts. * * @package opengamer_theme */ get_header(); $post_id = $post->ID; setPostViews($post_id); ?> <style> #masthead { background: rgb(52, 168, 83); } .menu-item a { color: #fff; border-bottom: solid 2px rgb(52, 168, 83); } .menu-item a:hover { border-bottom: solid 2px #fff; } </style> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main">
<?php $ajaxVal = $_GET['ajax']; if ($ajaxVal == "getPostViews") { setPostViews($_GET['postID']); echo getPostViews($_GET['postID']); }
function countShits() { $corazones = $_GET['corazones']; setPostViews(4, $corazones); die; }
function the_view() { echo getPostViews(get_the_ID()); if (is_single()) { setPostViews(get_the_ID()); } }
function themerex_callback_post_counter() { global $_REQUEST; if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) { die; } $response = array('error' => ''); $id = (int) $_REQUEST['post_id']; if (isset($_REQUEST['likes'])) { $counter = max(0, (int) $_REQUEST['likes']); setPostLikes($id, $counter); } else { if (isset($_REQUEST['views'])) { $counter = max(0, (int) $_REQUEST['views']); setPostViews($id, $counter); } } echo json_encode($response); die; }
</div> <div class="dt-sc-margin30"></div> <div class="container"> <!-- Primary Starts --> <section id="primary" class="content-full-width invt_det"> <?php while (have_posts()) { the_post(); $timezone = +5.5; $date = gmdate("F d, Y H:i:s", time() + 3600 * ($timezone + date("I"))); setPostViews(get_the_ID(), $date); ?> <input type="hidden" name="showninterest" id="showninterest" value="0" /> <div class="column dt-sc-one-fourth first" > <div class="id_logo"> <div class="portfolio-thumb"> <?php if (has_post_thumbnail()) { // $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) ); the_post_thumbnail(); } else { $img = wp_get_attachment_image_src(693); echo "<img src='" . $img[0] . "' />"; }
function single_views($postID) { $count = setPostViews($postID); echo '↔' . $count . '次浏览'; }
if (has_post_thumbnail()) { ?> <div class="container-fluid article-hero-image"> <?php $postFeatured = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?> <img src="<?php echo $postFeatured; ?> " class="img-responsive"> </div> <?php } // set post views $postId = get_the_ID(); setPostViews($postId); ?> <div class="container-fluid inner-page-content"> <div class="container"> <div class="row basic-page"> <div class="col-md-9"> <article class="main-article"> <h1><?php the_title(); ?> </h1> <div class="article-meta pull-left"> <div class="meta-title">SHARE</div> <div class="social-buttons small"> <ul class="no-bullets inline">
get_header('soms'); ?> <div class="category-news-block auto rek" style=" background-image: none !important; float:right !important; width:670px; margin-top:0px !important;"> <?php while ( have_posts() ) : the_post(); //стандартная итерация по массиву ?> <div style="background-color:#EEE; padding:20px;"> <h1 style="font-family:bandera_proregular; font-size:50px; border-bottom:0 !important; margin-bottom:0 !important;"> <?php the_title(); ?> </h1> <h1 style="font-family:Verdana, Geneva, sans-serif; border-bottom: 0 !important; font-size:25px; margin:0; padding:0;"> <span style="font-size:10px; color:#333;"><?php echo get_date_formatted(get_the_date('d.m.Y.H.i')); ?></span> <span style="font-size:10px; color:#333;"> Коментариев: <?php comments_number('0', '1', '%'); ?> Просмотров: <?php setPostViews(get_the_ID()); ?><?php echo getPostViews(get_the_ID()); ?></span> </h1> </div> <div style="overflow:hidden;" class="single-som"> <?php the_content(); ?> </div> <br> <script type="text/javascript">(function() { if (window.pluso)if (typeof window.pluso.start == "function") return; if (window.ifpluso==undefined) { window.ifpluso = 1; var d = document, s = d.createElement('script'), g = 'getElementsByTagName'; s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
<?php /* * Author: KhangLe * */ get_header(); setPostViews($post->ID, 'view-news'); ?> <div class="container news margin-top-xl margin-bottom-xl"> <div class="row"> <div class="col-xs-12 col-md-2"> <?php get_sidebar('news-left'); ?> </div> <div class="col-xs-12 col-md-7"> <article class="news-detail"> <h2><span><?php echo $post->post_title; ?> </span></h2> <p><?php echo $post->post_content; ?> </p> </article> </div> <div class="col-xs-12 col-md-3"> <?php