/** * Betheme Child Theme * * @package Betheme Child Theme * @author Muffin group * @link https://muffingroup.com */ /** * Load Textdomain */ add_action('after_setup_theme', 'mfn_load_child_theme_textdomain'); function mfn_load_child_theme_textdomain(){ load_child_theme_textdomain('betheme', get_stylesheet_directory() . '/languages'); load_child_theme_textdomain('mfn-opts', get_stylesheet_directory() . '/languages'); } /** * Enqueue Styles */ function mfnch_enqueue_styles() { // enqueue the parent stylesheet // however we do not need this if it is empty // wp_enqueue_style('parent-style', get_template_directory_uri() .'/style.css'); // enqueue the parent RTL stylesheet if ( is_rtl() ) { wp_enqueue_style('mfn-rtl', get_template_directory_uri() . '/rtl.css'); } // enqueue the child stylesheet wp_dequeue_style('style'); wp_enqueue_style('style', get_stylesheet_directory_uri() .'/style.css'); } add_action('wp_enqueue_scripts', 'mfnch_enqueue_styles', 101); // Register Custom Post Type function custom_reviews_post_type() { $labels = array( 'name' => _x( 'Custom Reviews', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'Custom Review', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'Custom Reviews', 'text_domain' ), 'name_admin_bar' => __( 'Custom Review', 'text_domain' ), 'archives' => __( 'Review Archives', 'text_domain' ), 'attributes' => __( 'Review Attributes', 'text_domain' ), 'parent_item_colon' => __( 'Parent Review:', 'text_domain' ), 'all_items' => __( 'All Reviews', 'text_domain' ), 'add_new_item' => __( 'Add New Review', 'text_domain' ), 'add_new' => __( 'Add New', 'text_domain' ), 'new_item' => __( 'New Review', 'text_domain' ), 'edit_item' => __( 'Edit Review', 'text_domain' ), 'update_item' => __( 'Update Review', 'text_domain' ), 'view_item' => __( 'View Review', 'text_domain' ), 'view_items' => __( 'View Reviews', 'text_domain' ), 'search_items' => __( 'Search Review', 'text_domain' ), 'not_found' => __( 'Not found', 'text_domain' ), 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ), 'featured_image' => __( 'Featured Image', 'text_domain' ), 'set_featured_image' => __( 'Set featured image', 'text_domain' ), 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ), 'use_featured_image' => __( 'Use as featured image', 'text_domain' ), 'insert_into_item' => __( 'Insert into review', 'text_domain' ), 'uploaded_to_this_item' => __( 'Uploaded to this review', 'text_domain' ), 'items_list' => __( 'Reviews list', 'text_domain' ), 'items_list_navigation' => __( 'Reviews list navigation', 'text_domain' ), 'filter_items_list' => __( 'Filter reviews list', 'text_domain' ), ); $args = array( 'label' => __( 'Custom Review', 'text_domain' ), 'description' => __( 'Customer Reviews', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', 'revisions', 'post-formats' ), 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-format-chat', // You can change the icon 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'custom-reviews', $args ); } add_action( 'init', 'custom_reviews_post_type', 0 ); // Shortcode to display custom reviews function display_custom_reviews() { $args = array( 'post_type' => 'custom-reviews', 'posts_per_page' => -1, // Retrieve all reviews ); $reviews_query = new WP_Query($args); // Check if there are any reviews if ($reviews_query->have_posts()) { $output = ''; // Initialize output // First testimonial-holder $output .= '
'; // Loop through each review while ($reviews_query->have_posts()) { $reviews_query->the_post(); $reviewer_name = get_field('reviewer_name'); $reviewer_image = get_field('reviewer_image'); $rating = get_field('rating'); $review_description = get_field('review_description'); switch($rating){ case "1 Star": $rating = '/wp-content/uploads/2023/09/1-star.svg'; break; case "2 Star": $rating = '/wp-content/uploads/2023/09/2-star.svg'; break; case "3 Star": $rating = '/wp-content/uploads/2023/09/3-star.svg'; break; case "4 Star": $rating = '/wp-content/uploads/2023/09/4-star.svg'; break; case "5 Star": $rating = '/wp-content/uploads/2023/09/5-star.svg'; break; default: break; } // Display each review using the specified HTML structure $output .= '
'; $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
' . $reviewer_name . '
'; $output .= '
'; $output .= '
'; $output .= '
' . $review_description . '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; $output .= '
'; } $output .= '
'; // Close first testimonial-holder // Duplicate testimonial-holder for the second time $output .= '
'; // Rewind the loop $reviews_query->rewind_posts(); // Loop through each review again while ($reviews_query->have_posts()) { $reviews_query->the_post(); $reviewer_name = get_field('reviewer_name'); $reviewer_image = get_field('reviewer_image'); $rating = get_field('rating'); $review_description = get_field('review_description'); switch($rating){ case "1 Star": $rating = '/wp-content/uploads/2023/09/1-star.svg'; break; case "2 Star": $rating = '/wp-content/uploads/2023/09/2-star.svg'; break; case "3 Star": $rating = '/wp-content/uploads/2023/09/3-star.svg'; break; case "4 Star": $rating = '/wp-content/uploads/2023/09/4-star.svg'; break; case "5 Star": $rating = '/wp-content/uploads/2023/09/5-star.svg'; break; default: break; } // Display each review using the specified HTML structure $output .= '
'; $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
' . $reviewer_name . '
'; $output .= '
'; $output .= '
'; $output .= '
' . $review_description . '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; $output .= '
'; } $output .= '
'; // Close second testimonial-holder } else { // No reviews found $output = '

No reviews found.

'; } // Reset post data wp_reset_postdata(); return $output; } add_shortcode('custom_reviews', 'display_custom_reviews'); Page not found | ACT Health Clinic

Ooops... Error 404

We are sorry, but the page you are looking for does not exist.

Please check entered address and try again or go to homepage