Categories
CMS Mastering Development Wordpress

WordPress auto RSS feed shows posts without making sense

WordPress auto RSS feed generator showing posts from different years although between the two dates I’ve been published 100 posts. https://www.secrettelaviv.com/feed?post_type=gd_place

Categories
CMS Mastering Development Wordpress

Change url of search with parameters

I have a users url now ie: example.com/users and when I search users it goes to: example.com/?s=Joe&cost=100 but I want it to keep the users path in the url instead of dropping it: example.com/users/?s=Joe&cost=100 I tried something like this but I just get a 404 error function wpb_change_search_url() { if ( is_search() && ! empty( […]

Categories
CMS Mastering Development Wordpress

Category images are not displaying in WordPress

I have categories list with there respective images. I am able to get the category name and description but I am not getting the category image. I tried the below code. <ul> <?php $categories = get_categories( array( ‘taxonomy’ => ‘category’, ‘orderby’ => ‘name’, ‘parent’ => 0, ‘hide_empty’ => 0, ) ); foreach ( $categories as […]

Categories
CMS Mastering Development Wordpress

Category images are not displaying in WordPress

I have categories list with there respective images. I am able to get the category name and description but I am not getting the category image. I tried the below code. <ul> <?php $categories = get_categories( array( ‘taxonomy’ => ‘category’, ‘orderby’ => ‘name’, ‘parent’ => 0, ‘hide_empty’ => 0, ) ); foreach ( $categories as […]

Categories
CMS Mastering Development Wordpress

How to display image sizes in API embedded?

I have just used regenerate images tool to regenerate image sizes and it was successful though I need those image sizes to show up in wp rest api in _embedded field. As you can see it’s an empty object. What should I do to enable image sizes there?

Categories
CMS Mastering Development Wordpress

How to disable single page for specific posts?

I need to disable single pages for specific posts, but only after specific condition. My code is here: add_shortcode(‘list-posts-basic’, ‘ant_post_listing_shortcode’); function ant_post_listing_shortcode($atts) { ob_start(); $query = new WP_Query(array( ‘post_type’ => ‘uredni_deska’, ‘posts_per_page’ => 5, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’, ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1, )); if ($query->have_posts()) { ?> <?php while ($query->have_posts()) […]

Categories
CMS Mastering Development Wordpress

Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?

I want to add an item to the cart (that same item gets discounted with the coupon) upon using a coupon code (with a hook). E.g. when using the coupon code SAMPLECODE, a product is added to the cart with a $2 discount. The coupon is set up to apply a $2 discount for that […]

Categories
CMS Mastering Development Wordpress

How to target all woocommerce categories that don’t have any subcategories in them?

I want to target all pages (product categories) that are displaying the products themselves. My woocommerce settings set to show only categories/subcategories (unless there are none) and then by default the products grid is displayed on the page. is_product_category() function doesn’t help since it also targets the parent categories which don’t have direct products in […]

Categories
CMS Mastering Development Wordpress

Get specific post in MODAL popup

I need to load posts in modal popup dynamically. I have found many solutions but upon trying nothing works for me. The solutions do not load the modal popup at all. I tried getting the ID from the post and then passing the ID to a new WP_Query but that results in modal not popping […]

Categories
CMS Mastering Development Wordpress

Invalid argument supplied for foreach()

I try ti get some value from a request and display it in a loop. I ve already use this system in an another function and that it worked but in this not. I get the message : Warning: Invalid argument supplied for foreach() function mic_services_shortcode($atts = [], $content = ”) { global $post; $id […]