Custom meta box in custom post type not working

Hey Change Callback function to like this and add_meta_box to add_meta_boxes hook function create_meta_box_slider() { add_meta_box( ‘new-meta-boxes-slider’, __(‘slider Settings’), ‘new_meta_box’, ‘slider’, ‘normal’, ‘high’ ); } add_action(‘add_meta_boxes’, ‘create_meta_box_slider’); function new_meta_box() { global $meta_box_groups; $meta_box_groups[] = $slide_info; } I think it work fine

What might cause a featured image not to display?

The php extension PHP GD was not installed on my dev machine. Installing php5-gd resolved this – sudo apt-get install php5-gd Stepping through using xdebug revealed that the theme’s aq_resize function was failing at the following code: else { $editor = wp_get_image_editor($img_path); if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) … Read more

Rewrite Question Mark in Post Template with URL Parameter for clean URLs

Your should add rewrite endpoint template on theme activation hook and init hook. Also there is some little checks to perform to prevent errors. function sjc_theme_activate(){ sjc_theme_add_rewrite_endpoint(); flush_rewrite_rules(); } //for more info http://codex.wordpress.org/Plugin_API/Action_Reference/after_switch_theme add_action( ‘after_switch_theme’, ‘sjc_theme_activate’ ); function sjc_theme_deactivate(){ flush_rewrite_rules(); } //for more info http://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme add_action( ‘switch_theme’, ‘sjc_theme_deactivate’ ); function sjc_add_query_vars($vars) { $vars[] = ‘template’; … Read more

Trouble in enquing all js files under certain directory

i think you’re putting too many extra bits on the file and path strings. try this : function _s_scripts() { $js_dir = get_template_directory_uri() . “/js/”; foreach(glob($js_dir.’*.*’) as $file) { $label = str_replace(“.”, “”, $file); wp_enqueue_script($label, $file , array(‘jquery’), ‘1.0.0’); } } add_action( ‘wp_enqueue_scripts’, ‘_s_scripts’ ); when I run a similar function locally against a dir, … Read more

Let user to add input fields on theme option page

You can do this by adding the following class in your theme for admin options; Custom-Metaboxes-and-Fields-for-WordPress And you can call your repeatable fields with some thing like this; array( ‘name’ => ‘Name of field’, ‘id’ => ‘prefix_option_name’, ‘type’ => ‘text’, ‘default’ => ”, ‘repeatable’ => true, ), For more details on how to use this … Read more