Articles of custom field

Make URL in custom field hyper link

In my WordPress site I have created a custom field for author website link. but I don’t know how to make it hyperlink, so people can click on it to surf that website. at this moment it only shows raw text. like: “www.example.com” my code is: <?php echo get_post_meta($post->ID, ‘Author Website’, true); ?>

Filtering a WP_Query meta_query by numeric values isn't working

That was a very dense title. I have a custom post type “event” which has a Date/Time picker field “event_date” thanks to the Advanced Custom Fields plugin. This Date/Time picker saves a UNIX timestamp to the database. I’m trying to use WP_Query to get all events that are today or in the future. This is […]

Is it bad to use a lot of Custom Meta Fields?

I am curious without doing a ton of benchmarks, how others feel about using several custom meta fields on a blog post? I am talking strictly performance wise, does it slow things down a lot if using a lot of fields, should we try to keep them to a minimum? Currently for a regular blog […]

Up/Down voting system for WordPress

Looking in all posts with keywords “voting system, upvote, downvote”, I can’t find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding it and try to modify its functionnalies so that they fit with the requirements. So, I am convinced in writing my own code […]

Transients vs CRON +Custom Fields: Caching Data Per Post

Wanted some opinions on a solution I’m trying to come up with: I have a fan/enthusiast plugin I’m working on for fans of TV shows. One of the custom post types attached to the plugin is a release type which stores data on dvd releases of a show. Some of the meta data that I […]

Check if a specific custom field exists?

Is it possible to check if a custom field exists for a given post within the loop? For example, I’m using functions like get_post_meta($post->ID, ‘Company’, true); preceded by a <h4> tag, but I’d like to check to make sure that there is a value for the custom field “Company” before writing the <h4>. Is this […]

How to add/save Custom Field in user settings/profile “Checkbox list”

i have been working on a custom system for my site where users can have a seperate account, setting and profile page to make my site a bit more interactive and community type. with some other additional stuff. I am new to coding, i have managed to make the profile pages etc. Right now i […]

WordPress Create Post from front-end

I’m having to design an e-commerce site where users should be able to create a product from front-end. In WordPress, the product will simply be a post with custom fields like Price, Condition,……. Also, from front-end, the user should be able to upload pictures. I just need some advice from you guys. What would be […]

Ordering posts by metadata

In my plugin, I use these instructions to obtain a list of posts: $args = array( ‘numberposts’ => -1, ‘offset’ => 0, ‘meta_query’ => array( array( ‘key’ => ‘metadata1’, ‘value’ => ’80’, ‘compare’ => ‘<=’, ‘type’ => ‘UNSIGNED’ ), array( ‘key’ => ‘metadata2’, ‘value’ => ‘4.6’, ‘compare’ => ‘<=’, ‘type’ => ‘DECIMAL’ ), ), ‘post_type’ […]

Loading scripts to the Post Edit page only

I have added a few meta boxes for the posts and pages, so I want to load a js script only on the Create/Edit post and page. How can I do that? Currently I’m using following but that loads the scripts in all pages in the admin. function my_meta_boxes() { add_meta_box(“post_meta”, “Meta”, “post_meta”, “post”, “normal”, […]