Articles of custom field

How to loop through certain custom field values

I am using ACF plugin and I would like to create an aggregate shortcode containing data from other pages which use custom fields. Can you help how to start? Thank you So some of my posts have custom fields such as “photo” allowed. I would like to query all posts and get the data from […]

How to “group” (categorize) the Pages together?

I have a lot of Pages which can be (need to be) grouped under a number of different Categories. ** Then the more important thing is, i need to control those pages (of different groups) programatically via functions.php. Lets say, i would have: Page A (Categorized as: Fruits) Page B (Categorized as: Vehicles) Page C […]

add_query_arg to compare and display events from a certain date

I have archive-events.php file that sorts custom post type ‘events’ via WP_Query using custom field that is date formatted YYYYMMDD (20150215) like this: $args = array( ‘post_type’ => ‘events’, ‘posts_per_page’=> 10, ‘meta_key’ => ‘wpcf-sort-events’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); $wp_query = new WP_Query( $args ); Then I made a widget that displays custom […]

How can I see a list of products that I have set to outofstock through a custom field check box?

So I have tons of products being displayed through my custom post type of products made by the ‘Advanced Custom Field’ and ‘Custom Post Type UI’ plugins. I made a very simple custom field named “stock” which is a checkbox and if true then the word “Out of Stock” is echoed next to the product, […]

Incorrect ordering of custom post type based on time

I have a custom post type as event which accept Custom fields’ values as gp_event_date as ( 2015/02/26) gp_event_time as (SIMILAR) to 08:00PM – 10:00PM format. And on the list page, it orders the display of post according to this date and time combination. But somehow the order is not proper, as it is not […]

ACF no print data

I’ve a problem with Advanced Custom Fields Plugin I create a custom field named: bgcolor I want to print the value in category.php, this is my code: $color = get_field(‘bgcolor’, ‘category_’.the_category_ID( $echo ).”); echo $color; What its wrong? Thanks

How to put forward a blog post

I would know if I can put forward a blog post natively using WordPress ? For example, I have created 20 posts, but I only show 5 on my homepage. Then imagine that I want to put the 18th at the first place ? By default WordPress order by publication date. I was thinking about […]

How to write specific HTML code with a specific custom field?

In my WordPress, each post can contains 2 buttons pointing to different links. To make it easy for the end user, I want to create a couple of Custom Fields where the user only needs to enter the URL of the link for Button A or Button B (or both), but once inserted, it will […]

How to add an extra, independent set of custom fields?

I’m looking for a plugin or sth to let the admin enter a list of specs (name & value) for a given type of post. The regular custom fields would work perfectly but of course, they are used by some other plugins and I don’t really want to filter them on my theme (since plugins […]

How to add a css class to custom field value?

In the user’s profile there is a dropdown list with options to choose from. The custom field name is colors with several values: red, green, blue, etc. Can I add a css class to those values. Like red_css, blue_css etc? To style accordinly. .blue_css {font-size: 10px;} Is that even possible? Thanks