// 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
*
*/
// Create a string to hold our Review box display string (code)
$pwc_thebox = '
' . esc_attr( $pwcrv_stored_meta['pwc_review_category'][0] ) . '
'; //$pwc_thebox .= '' . get_the_title() . '
' . 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 .= '' . __( 'Summary', 'pwc-reviews/languages') . '
' . wp_kses_post( $pwcrv_stored_meta['pwc_review_summary_area'][0] ) . '
endif; ?>