Articles of custom field

Adding custom url to readmore link using get_permalink()

I am having issues with a custom url. I have a page with a gallery type plugin/shortcode. Now each gallery item displayed on the page, has a readmore link, linking to that gallery item post. Now I created my own custom url variable that can be set on the gallery item post: This was added […]

Displaying information from custom field on custom post type

I have videos set up as a custom post type and music, commercial, promo set up as categories within this post type: I have a function that displays a custom meta box on the videos post type pages in the wordpress back end. The user is able to enter the ID of a youtube video […]

Plugin or shortcode for ISBN number?

I have a Woocommerce site with a catalogue of books. Each book has an ISBN (or EAN) number entered in a custom field. I need to do two things with the ISBN, and I don’t want to have to manually enter code for each product: I need to link to the Google books preview (at […]

Meta box values are displayed on Custom Fields list. Is it possible to hide them?

I have multiple meta boxes for my Custom Post Type posts. I want my users to add new fields using Custom Fields. The problem is – Custom Fields display all the garbage from my metaboxes and it might be very confusing for users. Here’s a screenshot, the two first fields were added by an user […]

Any way to update_post_meta with html content? It gets stripped and becomes empty

So I am cloning some divs created from an array using jQuery. Here is an example. I have a drop down list that contains items to add to the meta box. The add button clones a hidden div based on the name in the drop down that matches the rel of the div. This then […]

If metabox has content display content

I know how to display field content if the field has content. $monday = get_post_meta($post->ID, ‘_cmb_open_monday’, true); if ( ! empty ( $monday ) ) { echo ‘content’; } How do I display the content if one of the fields from the metabox “store_openingtimes” has content? Maby this explains better what i want to do: […]

How can I output the custom fields wrapping with HTML

I am trying to publish custom fields created using the plugin “Advanced Custom fields”. I am able to display them on posts and custom post types as raw output. But I want to wrap html around the output. Ex: Field-1(field name is ‘the_one’): I want to publish any content like Text or Date with the […]

Why can't I access Custom Taxonomy metadata?

I’m trying to access Custom Taxonomy metadata for all my custom taxonomy terms. The metadata is stored in options like so: $t_id = $term_id; $term_meta = get_option( “taxonomy_$t_id” ); $cat_keys = array_keys( $_POST[‘term_meta’] ); foreach ( $cat_keys as $key ) { if ( isset ( $_POST[‘term_meta’][$key] ) ) { $term_meta[$key] = $_POST[‘term_meta’][$key]; } } // […]

Filtering Custom Post Type by Comparing Date and Two Meta Keys

I am probably just overlooking something here, but some pointers would be greatly appreciated. I am trying to create an event website using WordPress and the Advanced Custom Fields plugin. Now the events have two options, they are either One Day Events, or Multiple Day Events. I have given them fields that the user can […]

Changing order in which custom fields appear in dashboard

I have several custom fields for my CPT. In dashboard page of my CPT, when editing a CPT, I see my custom fields in “custom fields” box. But I want to change the order in which they are displayed. Is it possible?