';
$breadcrums_id = 'breadcrumbs';
$breadcrums_class = 'breadcrumbs';
$home_title = esc_html__('Home','grand-popo');
$custom_taxonomy = 'product_cat';
// Get the query & post information
global $post, $wp_query;
// Do not display on the homepage
if (!is_front_page()) {
// Build the breadcrums
echo '
';
} else if (is_archive() && is_tax() && !is_category() && !is_tag()) {
// If post is a custom post type
$post_type = get_post_type();
// If it is a custom post type display name and link
if ($post_type != 'post') {
$post_type_object = get_post_type_object($post_type);
$post_type_archive = get_post_type_archive_link($post_type);
$no_found = esc_html__('No Post Found', 'grand-popo');
echo '
';
} else if (is_single()) {
// If post is a custom post type
$post_type = get_post_type();
// If it is a custom post type display name and link
if ($post_type != 'post') {
$post_type_object = get_post_type_object($post_type);
$post_type_archive = get_post_type_archive_link($post_type);
$no_found = esc_html__('No Post Found', 'grand-popo');
echo '
';
}
// Get post category info
$category = get_the_category();
if (!empty($category)) {
// Get last category post is in
$category_values = array_values($category);
$last_category = end($category_values);
// Get parent any categories and create array
$get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','), ',');
$cat_parents = explode(',', $get_cat_parents);
// Loop through parent categories and store in variable $cat_display
$cat_display = '';
foreach ($cat_parents as $parents) {
$cat_display .= '
' . $parents . '
';
$cat_display .= '
' . $separator . '
';
}
}
// If it's a custom post type within a custom taxonomy
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
if (empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
$taxonomy_terms = get_the_terms($post->ID, $custom_taxonomy);
if (isset($taxonomy_terms[0]) && property_exists($taxonomy_terms[0], 'term_id')) {
$cat_id = $taxonomy_terms[0]->term_id;
$cat_nicename = $taxonomy_terms[0]->slug;
$cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);
$cat_name = $taxonomy_terms[0]->name;
}
}
// Check if the post is in a category
if (!empty($last_category)) {
echo wp_kses_post($cat_display);
echo '
' . get_the_title() . '
';
// Else if post is in a custom taxonomy
} else if (!empty($cat_id)) {
echo '
';
} else if (is_page()) {
// Standard page
if ($post->post_parent) {
// If child page, get parents
$anc = get_post_ancestors($post->ID);
// Get parents in the right order
$anc = array_reverse($anc);
// Parent page loop
$parents = "";
foreach ($anc as $ancestor) {
$parents .= '
';
} else if (is_year()) {
// Display year archive
echo '
' . get_the_time('Y') . ' Archives
';
} else if (is_author()) {
// Auhor archive
// Get the author information
global $author;
$userdata = get_userdata($author);
// Display author name
echo '
esc_html__('Redux Framework', 'grand-popo'), // The plugin name.
'slug' => 'redux-framework', // The plugin slug (typically the folder name).
'required' => false, // If false, the plugin is only 'recommended' instead of required.
),
array(
'name' => esc_html__('Grand-Popo Core', 'grand-popo'), // The plugin name.
'slug' => 'grand-popo-core', // The plugin slug (typically the folder name).
'required' => true, // If false, the plugin is only 'recommended' instead of required.
),
array(
'name' => esc_html__('WooCommerce', 'grand-popo'), // The plugin name.
'slug' => 'woocommerce', // The plugin slug (typically the folder name).
'required' => false, // If false, the plugin is only 'recommended' instead of required.
),
);
$config = array(
'id' => 'grand-popo', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
tgmpa($plugins, $config);
}
add_action('tgmpa_register', 'grand_popo_register_required_plugins');
/**
* Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page
*/
function grand_popo_vcSetAsTheme() {
vc_set_as_theme();
}
add_action( 'vc_before_init', 'grand_popo_vcSetAsTheme' );
//REMOVE SUBCATEGORIES COUNT
function grand_popo_remove_category_products_count() {
return;
}
add_filter('woocommerce_subcategory_count_html', 'grand_popo_remove_category_products_count');
/**
* Get Footer sidebar
* Display widget set in footer-sidebar on footer
*/
function grand_popo_custom_widgets_init() {
global $grand_popo_options;
$number = grand_popo_get_proper_value($grand_popo_options, 'footer-sidebar-column', 4);
$search_number = grand_popo_get_proper_value($grand_popo_options, 'search-sidebar-column', 4);
if ($number == 1) {
$args = array(
'name' => esc_html__('footer column 1', 'grand-popo'),
'id' => 'footer-sidebar',
'description' => 'One of the footer sidebar column',
'class' => '',
'before_widget' => '
". esc_html__('Detailed specifications','grand-popo') . "" ;
}
add_filter('woocommerce_product_additional_information_heading', 'grand_popo_change_all_specifications_heading');
/*
* Get compare button
* @global $product
* @return $compare_link
*/
function grand_popo_get_compare_btn(){
global $product;
if(class_exists( 'YITH_Woocompare' ) ) {
?>
" class="compare button grand_popo-compare" data-product_id="id); ?>" rel="nofollow">
product_type == "variation")
$product_parent_id=wp_get_post_parent_id( $product_id);
else
$product_parent_id=$product_id;
$products_metas =get_post_meta($product_parent_id,'shipping-date-start',true);
if(isset($products_metas[$product_id]) && !empty($products_metas[$product_id]) && $products_metas[$product_id]>date('Y-m-d')){
echo esc_html__( 'Pre order', 'grand-popo' );
}
elseif($product->product_type == "external"){
}else{
echo esc_html__( 'Add to cart', 'grand-popo' );
}
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'grand_popo_single_add_to_cart_text' );
//remove woocommerce template loop product link close
remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_product_link_close',5);
/*
* Get texte of external product button
* @param type $product
* @param string $button_text
* @return $button_text
*/
function grand_popo_wc_external_product_button( $button_text, $product ) {
if ( 'external' === $product->get_type() ) {
// enter the default text for external products
return $product->button_text ? $product->button_text : esc_html__('Buy at Amazon','grand-popo');
}
return $button_text;
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'grand_popo_wc_external_product_button', 10, 2 );
// Get Grand-popo Pro features messages
function grand_popo_get_pro_features_messages()
{
$messages=array(
"Improved Speed"=> esc_html__('Do you feel the theme is a bit slow? Upgrade to make it faster.','grand-popo'),
"Pre-Orders"=> esc_html__('Sell new products, not on the market yet in exclusivity and enable your customers to be the first to receive the product as soon as it drops.','grand-popo'),
"Products Pack Recommendation"=> esc_html__('Recommend accessories and packs related to a product directly on its page.','grand-popo'),
"Product Comparison"=> esc_html__('Do you feel the theme is a bit slow? Upgrade to make it faster.','grand-popo'),
"Grouped Attributes"=> esc_html__('Create and assign a set of product attributes to any product, no more wasting of time to write them one by one.','grand-popo'),
"Brands Module"=> esc_html__('Allows you to manage multiple brands in your shop and help your customers browse your platform by brands.','grand-popo'),
"+600 Google fonts"=> esc_html__('Grand-Popo is offering you a large variety of typefaces, to enable you create the typography that best suits your online shop.','grand-popo'),
"Highly customizable"=> esc_html__('Personalize the look and feel of your website with colors, icons, font and logo.','grand-popo'),
"Flexible shop layout"=> esc_html__('The theme offers an unlimited option such as customizable sidebars, pagination options, filter options, shop layout styles and more.','grand-popo'),
"Authentic customer support"=> esc_html__('No matter the technical problems you face, our developers are ever-ready to give you a helping hand.','grand-popo'),
"Simple Installation & Setup"=> esc_html__('Includes a user manual that would help you build pages easily and without stress.','grand-popo'),
"Onclick demo"=> esc_html__('Includes a many demo of home page that would help you build pages easily and without stress.','grand-popo'),
);
return $messages;
}
get( 'paged' ) ); $per_page = $wp_query->get( 'posts_per_page' ); $total = $wp_query->found_posts; $first = ( $per_page * $paged ) - $per_page + 1; $last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged ); if($total==1){ printf( _x('Showing the single result', $total, 'grand-popo'), $total); } elseif ($total <= $per_page || -1 === $per_page) { /* translators: %d: total results */ printf( _n( 'Showing the single result', 'All %d results', $total, 'grand-popo' ), $total ); } else { /* translators: 1: first result 2: last result 3: total results */ printf( _nx( 'Showing the single result', ' %1$d–%2$d of %3$d results', $total, 'with first and last result', 'grand-popo' ), $first, $last, $total ); } ?>
$filter) { foreach ($filter as $identifier => $function) { if (is_array($function) and is_a($function['function'][0], $class) and $method === $function['function'][1]) { remove_filter( $tag, array($function['function'][0], $method), $priority ); } } } } } /** * Get product cat icon field * @param $term * @return $icon field */ function grand_popo_get_icon_fields($term = false) { $icon_url = ""; $img_placeholder = get_template_directory_uri() . '/assets/images/placeholder.png'; $img_src = $img_placeholder; if ($term) { $icon_url = get_term_meta($term->term_id, "prod_cat_icon", true); $img_src = $icon_url; if (empty($icon_url)) $img_src = $img_placeholder; } ?>