New answers tagged

2 votes
Accepted

How get custom field from custom taxonomy?

Since you are using ACF, you can take advantage of the get_field() function ACF provides. You will need to pass the term object as the second parameter. $image = get_field( 'field_key', $custom_term );...
user avatar
  • 2,615
2 votes

How get custom field from custom taxonomy?

The thumbnail is probably stored in the termmeta table using a meta key specified the jetengine plugin, which is out of scope here. You should be able to identify the key by querying the DB for one of ...
user avatar
  • 16.9k
1 vote

Take a custom taxonomy value and save as a standard Product Tag

Got it worked out, working code as follows: function action_save_product_data( $post_id ) { if ( 'product' !== $post->post_type ) { $terms = wp_get_post_terms( $post_id, 'product_brand', ...
user avatar
1 vote
Accepted

how to show records that don't have custom meta value

the most clicked item should be first and the items that haven't been clicked yet should be last, but they are not showing up at all They aren't showing up because your posts query is only selecting ...
user avatar
  • 31.4k
1 vote
Accepted

Dynamically insert code to custom post type loop

Create a variable outside the array and then pass it to the array: <?php $catfilm = get_post_meta( get_the_ID(), "mytheme_catfilm", true ); $blog = array( 'post_type' => '...
user avatar
  • 4,850
1 vote
Accepted

Custom Post Types not queried in Custom Taxonomy archives or Native archives

Tags shared by CPTs and standard posts return only the latter, and topics archives or tag archives with only CPTs assigned return empty. As for the tag archives, that's a default behavior in ...
user avatar
  • 31.4k
1 vote
Accepted

Set term on an attachment using wp_set_object_terms and want to display the full term text but it's showing a slug instead

When a visitor fills out the email address field with "name@email.com", what is displayed on the Attachment details screen (as in siteurl.com/wp-admin/upload.php?item=xx ) for that email ...
user avatar
  • 31.4k
0 votes

Custom post type category link redirecting to 404 page

Its because you are already registered the cpt as blog and set has_archive to true. That means, the url https://example.co/blog/ will act as the archive page for that CPT and URLs like this (https://...
user avatar
  • 2,615
0 votes
Accepted

Add custom taxonomy to post content body?

Even though extending your custom search would be the proper WP way to solve your problem, the answer to your workaround question would be the below function: function change_content_on_save($post_id, ...
user avatar
  • 297
0 votes

Query posts by multiple custom fields

Not sure if you're using a WP_Query or WP_Meta_Query but it shouldn't matter. $args = array( 'numberposts' => -1, 'post_type' => 'providers', 'meta_query' => array( ...
user avatar

Top 50 recent answers are included