Tag Info

Hot answers tagged

2

There are approx. 10,000 items returned by the query. That's your problem right there. No matter what you do inside the loop, WordPress is still loading 10,000 post objects into memory. Batch it up and sprinkle a little magic in your query arguments: $args = array( 'fields' => 'ids', // MAGIC! Just get an array of id's, no objects ...


1

What is the exact meta_key and meta_value for the field I created using the function custom_user_profile_fields ? created_by and some user ID, for example: $args = array( 'meta_key' => 'created_by', 'meta_value' => 123, ) You could use a meta_query for more complex searches. $args = array( 'meta_query' => ...


1

If you have a lot of categories it will be a pain to search everytime every category and check against the field value. I wrote something and I would love to know if it's correct or not 1st I wrote a function that get the option name from the value since wordpress core provide only a function that get the option value from name function ...


1

Yes there are lot of ways you can achieve this by using plugin or pragmatically This Plugin will create custom content types as well as custom fields for specific content type: https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/ However you can also do this via pragmatically: ...


1

WordPress uses Custom Fields (also called post meta on technical side) for storage of arbitrary data, associated with the posts. Note that it is different from Taxonomies, which is also available for respective kind of grouping data. However, especially in case of custom fields, it doesn't provide much in terms of building custom interfaces for that ...



Only top voted, non community-wiki answers of a minimum length are eligible