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”, … Read more

Custom Posts Hierarchy? (State/City/Restaurant)

Question: What is the best way to create a hierarchy structure (also called parent/child relationships) between custom post types? For example, we currently have 3 post types: States, Cities, and Restaurants. Each Restaurant will be in a city, and each city will of course be in a state. So for example, Joe’s Crab Shack would … Read more

Ajax form filter post by custom fields [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 years ago. Improve this question I’m currently working on a site where users can search for apartments. I have a … Read more

Custom fields on a virtual page

I’ve used Dave Jesch’s solution for making virtual pages (from content temporarily saved in a custom database table, updated from an RSS every four hours). See more here: http://davejesch.com/wordpress/wordpress-tech/creating-virtual-pages-in-wordpress/ So far I’ve verified that the url looks like one of a virtual page (i.e. it’s the child of a certain slug and it contains numbers … Read more

Query Custom Post Types by date (custom field) range

I’ve seen similar questions and solutions, but so far I couldn’t apply it to my code. The following code (functions.php) works perfectly fine: if( isset($query->query_vars[‘post_type’]) && $query->query_vars[‘post_type’] == ‘turniere’ ) { $query->set(‘orderby’, ‘meta_value_num’); $query->set(‘meta_key’, ‘date_start’); $query->set(‘order’, ‘ASC’); } Now I want to add a sort of date range. This is the “best” I’ve got so … Read more

Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host

OK, firstly we have done this before using Magento and it worked well, but with WordPress? Well, here is the problem and the plan… The Problem For a few reasons we wish to use a 3rd Party host for all our e-commerce images in the Storefront Theme of Woocommerce. As we are using an import … Read more

Add custom taxonomy under the category title

I’ve added a custom taxonomy to my product category page in the admin. I can call the custom field using the following: $queried_object = get_queried_object(); $t_id = $queried_object->term_id; $term_meta = get_option( “taxonomy_$t_id” ); echo $term_meta[‘custom_term_meta’]; It describes the category. For example, if I added a title for a particular product category named “Address Labels” I … Read more

Storing data into custom taxonomies VS post custom fields (post meta)

I’m wondering what’s more efficient when it comes to performing search for data. I am building a job board where I have an option to store information like: Company Name (Searchable) City (Searchable) Skill (Searchable) Location (Searchable While fields like ‘City’, ‘Skill’ and even ‘Location’ can be stored as custom taxonomies; I’m not sure if … Read more