Ejemplo n.º 1
0
<?php

/*
Template Name: Team member
*/
get_header();
$single_style = 'single-team';
//axiom_get_custom_option('single_style');
while (have_posts()) {
    the_post();
    // Move axiom_set_post_views to the javascript - counter will work under cache system
    if (axiom_get_custom_option('use_ajax_views_counter') == 'no') {
        axiom_set_post_views(get_the_ID());
    }
    //axiom_sc_clear_dedicated_content();
    axiom_show_post_layout(array('layout' => $single_style, 'sidebar' => !axiom_sc_param_is_off(axiom_get_custom_option('show_sidebar_main')), 'content' => axiom_get_template_property($single_style, 'need_content'), 'terms_list' => axiom_get_template_property($single_style, 'need_terms')));
}
get_footer();
Ejemplo n.º 2
0
 function axiom_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']);
         axiom_set_post_likes($id, $counter);
     } else {
         if (isset($_REQUEST['views'])) {
             $counter = max(0, (int) $_REQUEST['views']);
             axiom_set_post_views($id, $counter);
         }
     }
     echo json_encode($response);
     die;
 }