Execute js files doesn’t seem to work

Just hook to wp_enqueue_scripts for both registering and enqueueing. You’ve registered with in_footer (last parameter in your code) true so what you need is: function print_my_royal_slider_script() { global $add_my_script; if ( ! $add_my_script ) return; wp_enqueue_script(‘my-script’); } add_action (‘wp_enqueue_scripts’, ‘print_my_royal_slider_script’); The problem is going to be with $add_my_script. That has to be set before wp_head … Read more

Migrating old posts to new wp, how to extrapolate infos from the post body to custom fields?

The short answer is that you Loop over all of you posts and use (probably) preg_match to extract information. The long answer is that this could be pretty tricky, depending on how consistent your data entry is. Here is an example: global $wpdb; $sql = “SELECT ID,post_content FROM {$wpdb->posts}”; $allp = $wpdb->get_results($sql); foreach ($allp as … Read more

Custom Metabox additional item

Your above code should be working as is. There is however one logical error at the end of your saving function – you make the saving of both fields dependent on whether $_POST[‘_url’] is set. I suppose that is not intentional. You likely want something along the lines of: if ( isset( $_POST[‘_url’] ) ) … Read more

Multiple URLS per post non-ascii

Add a new field below the post title and use something like my transliteration table to convert the post slug to US-ASCII. Then save that new slug in a meta field. Hook into 404_template (example), and run a meta query for the current slug. If you found something, use get_permalink() for the result and wp_redirect() … Read more

Is it possible to activate customfield ‘text description’ upon activating the customfield ‘checkbox’?

A possible solution is to use jquery to show/hide your custom field, something like this: <script> jQuery(document).ready(function($) { $(‘#yourcheckboxidentifier’).click(function() { $(‘#customfieldidentifier’).fadeToggle(400); }); if ($(‘#yourcheckboxidentifier’).val() !== undefined) { $(‘#customfieldidentifier’).show(); } }); </script>

Change order of posts

Your question is not very detailed. It is hard to work out exactly what you are doing but I am assuming that you are trying to sort posts by a custom meta meta_key/meta_value. This the formula for that (annotated but basically lifted from the Codex): $args = array( ‘post_type’ => ‘your_post_type’, // I don’t know … Read more