Skip to content
Advertisement

Tag: wordpress

WordPress IF ELSEIF and ELSE Statement

Can someone explain why this does not work? Basically if not the home page or a page with ID 105 show the contact form, else if it is the home page show ‘no side bar’ else for everything else show ‘different side bar’ – it doesnt work as the home page still shows the ‘different side bar’ (and doesnt show

How to modify woocommerce_before_cart action

I’m trying to make my woocommerce cart template display as a full 12 column layout. The existing layout is using bootstrap’s col-sm-8 column. I need to change it to col-sm-12. I checked out the relevant woo-templates shown here, and copied the cart.php template into my theme to override. However, it looks like I need to modify the woocommerce_before_cart action to

is_page and query_posts not working correctly

For some reason the following code is displaying both types of posts instead of just the specified post using query_posts. I am not quite sure what is going on, but it appears that the loop is ignoring my condition of is_page(‘news’) or is_page(‘othernews’). Does anyone have an idea why this might be the case? Answer Try this whether this works

get the current page id inside wordpress plugin page

I need to get the current page id in WordPress plugin page outside the loop. And the code I wrote for getting current page id is in my plugin page. I tried many codes, but doesn’t work But it doesn’t work for me . This is also not working. When I try Then a error message appears Fatal error: Call

Advertisement