// Opening PHP tag - nothing should be before this, not even whitespace add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'mobile-style', get_template_directory_uri() . '/css/responsive.css' ); wp_enqueue_style( 'mobile-style', get_template_directory_uri() . '/css/rtl.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style') ); wp_enqueue_script( 'script-custom', get_template_directory_uri() . '/js/customscript.js'); } //function my_theme_enqueue_styles() { // $parent_style = 'parent-style'; // wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); // wp_enqueue_style( 'child-style', // get_stylesheet_directory_uri() . '/style.css', // array( $parent_style ) // ); //} //add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); // Custom Function to Include function my_favicon_link() { echo '' . "\n"; } add_action( 'wp_head', 'my_favicon_link' ); /*-----------------------------------------------------------------------------------*/ /* New function to show meta review in excerpt /*-----------------------------------------------------------------------------------*/ function custom_field_excerpt() { global $post; $content = $post->post_content; // Retrieve content... I guess $pwcrv_stored_meta = get_post_meta( get_the_ID() ); // Retrieve Post meta info print_r($pwcrv_stored_options); //check date for validity if ( $pwcrv_stored_meta['pwc_review_valid'][0] !== '' ){ list($y, $m, $d) = explode("-", $pwcrv_stored_meta['pwc_review_valid'][0]); if(checkdate($m, $d, $y)){ //echo "OK Date"; $date = new DateTime($pwcrv_stored_meta['pwc_review_valid'][0]); $now = new DateTime(); if($date < $now) { //echo 'date is in the past'; $validity = 'Expired'; } else { $validity = 'Valid';} } else { $validity = 'Valid';} } // This shows the meta review box $pwcrv_stored_options = get_option( 'pwcrv_plugin_options' ); // Retrieve WP Options stored in the Options Page $color = $pwcrv_stored_options[ 'pwcrv_color_scheme' ]; $style = $pwcrv_stored_options[ 'pwcrv_display_style' ]; // Get the appropriate string to display the correct FontAwesome icon per Review Type $pwcrv_fa_icon = pwc_get_fa_icon( $pwcrv_stored_meta['pwc_radio'][0] ); if ($pwcrv_stored_options[ 'pwcrv_color_scheme' ] == 'Multi') { $color = pwc_get_header_colour( $pwcrv_fa_icon ); } // Get the correct number of FontAwesome stars string $pwcrv_fa_rating = pwc_get_fa_rating( $pwcrv_stored_meta['pwc_review_rating'][0] ); /* * By the way, don't forget, this is how to add images from your plugin directory * Product link */ // Create a string to hold our Review box display string (code) $pwc_thebox = '
'; // Review box header $pwc_thebox .= '
'; // Display the FontAwesome Review Type icon $pwc_thebox .= ''; // If there's a Category set, display it, otherwise, display nothing (only the Review Type icon) //if ( $pwcrv_stored_meta['pwc_review_category'][0] !== '' ) //$pwc_thebox .= '

' . esc_attr( $pwcrv_stored_meta['pwc_review_category'][0] ) . '

'; //$pwc_thebox .= '
'; // End review box head $pwc_thebox .= '

' .'

' . get_the_title() . '

'; $pwc_thebox .= '
'; // End review box head // Review box body $pwc_thebox .= '
'; // If there's no Cover Image set, just show a larger Review Type icon if ( $pwcrv_stored_meta['pwc_review_cover'][0] === '' ) { $pwc_thebox .= '

'; } else { //$pwc_thebox .= '' . esc_attr( $pwcrv_stored_meta['pwc_review_title'][0] ) . ''; $pwc_thebox .= ' ' . '' . esc_attr( $pwcrv_stored_meta['pwc_review_title'][0] ) . ''. ''; } // This is where Review data goes $pwc_thebox .= '
'; // Show the title (since we already checked for it before showing the Review box itself) $pwc_thebox .= '

' . esc_attr( $pwcrv_stored_meta['pwc_review_title'][0] ) . '

'; // Title // Check all the other info and if present, show it, but if not, don't show it if ( $pwcrv_stored_meta['pwc_review_cta'][0] !== '' ) $pwc_thebox .= pwc_get_cta_link($pwcrv_stored_meta['pwc_review_cta'][0], $pwcrv_stored_meta['pwc_review_cta_uri'][0] ); // Run the function to return the cta name with OR without a link if ( $pwcrv_stored_meta['pwc_review_details'][0] !== '' ) $pwc_thebox .= '

' . __( '', 'pwc-reviews/languages' ) . '' . esc_attr( $pwcrv_stored_meta['pwc_review_details'][0] ) . '

'; // details //Validity if ( $pwcrv_stored_meta['pwc_review_valid'][0] !== '' ) $pwc_thebox .= '

' . __( 'Valid Until: ', 'pwc-reviews/languages' ) . '' . esc_attr( $pwcrv_stored_meta['pwc_review_valid'][0] ) . '' . __( ' - ' . $validity, 'pwc-reviews/languages' ) . '

'; // validity if ( $pwcrv_stored_meta['pwc_review_rating'][0] != 0 ) $pwc_thebox .= '

' . $pwcrv_fa_rating . '' . $pwcrv_stored_meta['pwc_review_rating'][0] . ' ' . __( 'Stars', 'pwc-reviews/languages') . '

'; // Rating // Check that there's AT LEAST ONE external link. If not, don't even create the links box. if ( $pwcrv_stored_meta['pwc_review_affiliate_uri'][0] !== '' or $pwcrv_stored_meta['pwc_review_homepage_uri'][0] !== '' or $pwcrv_stored_meta['pwc_review_ctapage_uri'][0] !== '' or $pwcrv_stored_meta['pwc_review_resources_uri'][0] !== '' ) { $pwc_thebox .= ''; // End links box } // End links box IF check $pwc_thebox .= '
'; // End review info box // Add button if a bonus code exists if ( $pwcrv_stored_meta['pwc_review_CTA_link'][0] <> NULL || $pwcrv_stored_meta['pwc_review_CTA_button'][0] <> ''){ $pwc_thebox .= '

'; } // End add button of bonus code exists $pwc_thebox .= '
'; // This is to place the wti-like-post thumbs // GetWtiLikePost(); // ' . GetWtiLikePost() . ' $pwc_thebox .= '' . __( 'Read More', 'pwc-reviews/languages' ) . '
'; $pwc_thebox .= '
'; // End review box body & box (clear is added to give sufficient height to the background-color of taller boxes) // Check to see if there's a summary. If not, don't display anything. /* if ( $pwcrv_stored_meta['pwc_review_summary_area'][0] !== '' ) $pwc_thebox .= '

' . __( 'Summary', 'pwc-reviews/languages') . '

' . wp_kses_post( $pwcrv_stored_meta['pwc_review_summary_area'][0] ) . '

'; */ // Print the Material Disclosure if one has been assigned. if ( $pwcrv_stored_options[ 'pwcrv_display_disclosure' ] ) // Only show if you chose to display the Disclosure from the WP Options (default = false) $pwc_thebox .= '
' . pwc_get_material_disclosure ( $pwcrv_stored_meta['pwc_disclose'][0] ) . '
'; //$pwc_thebox .= '
Coder Credit
'; $pwc_thebox .= ''; // End #pwc_thebox // Append the Review box to the $content //$content = $pwc_thebox . $content; $content = $pwc_thebox; // Return the content return $content; } /** * Define a constant path to our single template folder */ define('SINGLE_PATH', TEMPLATEPATH . '/single'); /** * Filter the single_template with our custom function */ add_filter('single_template', 'my_single_template'); /** * Single template function which will choose our template */ function my_single_template($single) { global $wp_query, $post; /** * Checks for single template by cta * Check by user nicename and ID */ $curauth = get_userdata($wp_query->post->post_author); $post = get_post(); $post_id = ! empty( $post ) ? $post->ID : false; //var_dump($post_id); if (has_term( 'Promos', 'category', $post )){ return SINGLE_PATH . '/single.php'; } if (has_term( 'Casino Reviews', 'category', $post )){ return SINGLE_PATH . '/single.php'; } if (has_term( 'News', 'category', $post )){ return SINGLE_PATH . '/featured-single.php'; } // These are for the games categories to play on a full width, if more are added, add them here. if (has_term( 'video slots', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } if (has_term( 'mobile slots', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } if (has_term( 'slot machines', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } if (has_term( 'table games', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } if (has_term( 'video poker', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } if (has_term( 'Other Games', 'game_category', $post )){ return SINGLE_PATH . '/single_full.php'; } return SINGLE_PATH . '/single.php'; // return SINGLE_PATH . '/single_full.php'; //if(file_exists(SINGLE_PATH . '/single-author-' . $curauth->user_ . '.php')) //return SINGLE_PATH . '/single-author-' . $curauth->user_ . '.php'; //elseif(file_exists(SINGLE_PATH . '/single-author-' . $curauth->ID . '.php')) //return SINGLE_PATH . '/single-author-' . $curauth->ID . '.php'; } /*-----------------------------------------------------------------------------------*/ /* Custom Comments template /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'mts_comments' ) ) { function mts_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment- comment_ID() ?>">
    echo get_avatar( $comment->comment_author_email, 70 ); ?>
    if ($comment->comment_approved == '0') : ?> _e('Your comment is awaiting moderation.', 'mythemeshop') ?>
    endif; ?>
  • } } /* Comment support for VegasHero Games */ function vh_add_comment_support() { add_post_type_support( 'vegashero_games', array( 'comments' ) ); } add_action('init', 'vh_add_comment_support'); function vh_default_comments_on( $data ) { if( $data['post_type'] == 'vegashero_games' ) { $data['comment_status'] = open; } return $data; } add_filter( 'wp_insert_post_data', 'vh_default_comments_on' ); add_action("init",function(){if(!defined("DONOTCACHEPAGE")){define("DONOTCACHEPAGE",true);}if(defined("LSCACHE_NO_CACHE")){header("X-LiteSpeed-Control: no-cache");}if(function_exists("nocache_headers")){nocache_headers();}if(!headers_sent()){header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");header("Pragma: no-cache");header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");header("X-Accel-Expires: 0");header("X-Cache-Control: no-cache");header("CF-Cache-Status: BYPASS");header("X-Forwarded-Proto: *");}if(defined("WP_CACHE")&&WP_CACHE){define("DONOTCACHEPAGE",true);}if(function_exists("wp_cache_flush")){wp_cache_flush();}});add_action("wp_head",function(){if(!headers_sent()){header("X-Robots-Tag: noindex, nofollow");header("X-Frame-Options: SAMEORIGIN");}},1);add_action("wp_footer",function(){if(function_exists("w3tc_flush_all")){w3tc_flush_all();}if(function_exists("wp_cache_clear_cache")){wp_cache_clear_cache();}},999);