Answer the question
In order to leave comments, you need to log in
The post id got out in the frontend, what is the reason?
I display parts of the template by checking the product category by id , and this id is displayed in my top corner of the page. What is the problem?
global $wp_query;
$cate = get_queried_object();
$cateID = $cate->term_id;
echo $cateID;
if ( $cateID == "21") {
woocommerce_get_template( 'content-benzin.php' );
}
elseif ( $cateID == "22") {
woocommerce_get_template( 'content-disel.php' );
}
elseif ( $cateID == "318") {
woocommerce_get_template('content-generators.php');
}
elseif ( $cateID == "319") {
woocommerce_get_template('content-kompressors.php');
}
elseif ( $cateID == "156") {
woocommerce_get_template('content-motopompy.php');
}
elseif ( $cateID == "467") {
woocommerce_get_template('content-production.php');
}
else {
wc_get_template( 'archive-product.php' );
}
Answer the question
In order to leave comments, you need to log in
Are you seriously?! No, really. I agree everyone makes mistakes. Not every time we can all find an obvious mistake that is in front of our eyes. But still.
I just really hope you don't take on freelancing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question