Query Product categories what have a custom field

Im trying to build a page template on wordpress that will show a list a categories that have a custom field checked.

So the taxonomy is just the default woocommerce taxonomy product_cat I then have a custom field to the product_cat taxonomy which is a check box called collectable

My set up is
Main Category

  • Child
  • Child
  • Child
  • Child

So for example 2 children categories have the tick box collectable which is set to add the value of 1 into the datbase

So I am doing a page where it will show all categories with the collectable checked.

$args = array(
    'post-type' => 'product',
    'taxonomy' => 'product_cat',
    'hide_empty' => 0
  );
  $c = get_categories($args);
  $c_keep = array();
  foreach($c as  $cat){
 if (get_field('collectable', 'category_'.$cat->term_id)) {
      $c_keep[] = $cat;
    }  
  }
  
  foreach($c_keep as $cat){
    echo $cat->name;
  }

But I am getting nothing at all returned.

I even put a

print_r( $args );

But I am still coming up with a blank (Header and footer Loads and the text above the query)

Can anyone help please

Go to Source
Author: user1348927

How do I change the markup only of a built-in widget?

I’m developing a theme and I’d like to slightly alter some of the HTML output of some of the built-in widgets. As of now, I managed to change the sidebar search widget by creating a searchform.php file in my theme — though that might not only be the sidebar widget but alright.

I’m now onto the Archives widget. I literally just need to alter the bit that says “Archives” to change its tag and add a class. Do I really need to make my own (largely identical) class and register it and use my custom widget instead?

(If you can’t tell, I haven’t touched WP theming in around 10 years 🙂

Go to Source
Author: Morpheu5

How to reorder hooks output order of Seconday menu and Product search (Storefront theme)

I would like to center Product search on about the same line with Site logo and align right on the same line the secondary menu on site https://prettify.ru (I’m not advertising or something… I put a link just to be more concrete on the subject. Hopely it is not against rules).
The default hooks’ output for Storefront theme is like this

  1. Site Branding (logo e.t.c.)
  2. Secondary menu
  3. Product search
  4. Primary navigation menu

e.t.c.

I was trying to play with CSS with that set up but it seems pretty hard for me (I’m a noob, ha ha) to center Product Search for all resolutions with that hooks order.
My Idea how to do habdle this is to change output priorities: show Product search right after Site Branding and then Show Secondary menu. Only after that play with CSS rules/styling.

What I’m see at storefront-template-hooks.php is

add_action( 'storefront_header', 'storefront_header_container', 0 );
add_action( 'storefront_header', 'storefront_skip_links', 5 );
add_action( 'storefront_header', 'storefront_site_branding', 20 );
add_action( 'storefront_header', 'storefront_secondary_navigation', 30 );
add_action( 'storefront_header', 'storefront_header_container_close', 41 );
add_action( 'storefront_header', 'storefront_primary_navigation_wrapper', 42 );
add_action( 'storefront_header', 'storefront_primary_navigation', 50 );
add_action( 'storefront_header', 'storefront_primary_navigation_wrapper_close', 68 );

No call for search function. My logic was like that: find output for product search and set priority higher than storefront_secondary_navigation: let say 25. But I can not find where the search priority is set up. I’m using AJAX Search for WooCommerce plugin and that makes things to be a bit more complicated, he he.
Can someone please suggest how to reorder items in header?
Will it work for my target: center cearch and align secondary menu right?

Go to Source
Author: 0LEg

Show products per page drop down

So i have a wordpress woocommerce site and I would like to add a button under the pagenumbers (do you call this pagination?) so the user can select himself how many products to view per page, ie 20, 40, 80 etc.

I would like it to be at the bottom under the page numbers, I have tried a solution that leaves the drop down at the top, near where it says “Showing products 1-20..” not quite where I want it.

Any ideas? point me to a thread or tutorial on this?

Thanks for reading!

Mike

example i like https://www.funko.com/shop (see bottom)

Go to Source
Author: Mikebb

How can I add a custom Javascript snippet to display my feedback in footer?

I have the following Javascript snippet:

<script type="text/javascript" src="<script type="text/javascript" src="//www.auctionnudge.com/feed/feedback/js/theme/profile_table/limit/6/lang/english/UserID/stockmustgo/siteid/3"></script><div id="auction-nudge-feedback" class="auction-nudge"></div>

Which should dynamically display my eBay feedback like this:

https://gyazo.com/1ddc1e3f2ca21c91897a986a01654df8

How can I add this to my wordpress site? I tried installing the ‘ Header and Footer Scripts ‘ plugin to no avail. I’m sure it’s simple but I’m a beginner when it comes to anything web dev related.

It doesn’t need to be displayed in the footer. It can be within the body. I’ve asked around and I couldn’t find anyone that could help so I thought I’d try here. Thanks.

Go to Source
Author: Chrome123

images click popup form and submit images captions in email to admin?

Create Custom Post gallery..archive page display images.
customer can click Enquiry Now button.. this button popup form submit all detalies name,email,phone no,msg to send email to admin

Go to Source
Author: Ashvin Monpara