Why is my custom meta box input not saving

Try changing: <input class=”widefat” type=”text” placeholder=”[galleryview id=X]” name=”rs-job-gallery” id=”rs-job-gallery” value=”<?php echo esc_attr( get_post_meta( $object->ID, ‘rs_job_gallery’, true ) ); ?>” size=”30″/> to this: <input class=”widefat” type=”text” placeholder=”[galleryview id=X]” name=”rs_job_gallery” id=”rs-job-gallery” value=”<?php echo esc_attr( get_post_meta( $object->ID, ‘rs_job_gallery’, true ) ); ?>” size=”30″/> Reason: When the “name” attribute is set in the input field, that becomes the $_POST[‘input_name’] … Read more

WordPress category loop offset possible?

The ‘offset’ parameter does what you want. I’ve written this hack, it should help you… <?php //The third parameter corresponds to action priority, //set it to change the order of execution in case of a conflict add_action(‘pre_get_posts’, ‘the_modified_loop’, 10); function the_modified_loop($query){ //Remove ‘is_admin’ if you want the code to run for the backend category archive … Read more

Drop down+sort blog posts date added/most popular

Yes, we can sort WordPress posts in different orders, You can do following sorts without installing plugins. sort post by date ( ascending / descending ) Sort post by title (ascending / descending ) Sort post by comment count ( ascending / descending ) — These are just basic we can do even more using … Read more

wp_customize_image_control default value

I had the same problem a few minutes ago. Here is what I used in the src tag: <?php if (get_theme_mod( ‘custom_logo_image’ )) : echo get_theme_mod( ‘custom_logo_image’); else: echo get_template_directory_uri().’/inc/images/default_logo.png’; endif; ?> It seemed to solve my problem. Let me know if it works for you.

Does WordPress cache get_user_meta() results?

Yes, it does. That function is a wrapper for get_metadata(). Inside of that you can find: $meta_cache = wp_cache_get($object_id, $meta_type . ‘_meta’); if ( !$meta_cache ) { $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); $meta_cache = $meta_cache[$object_id]; }

is there a simple way to list every templates / php files used to generate a specific page?

WordPress does not really track what theme files are loaded beyond some basic things (for example $template global holds main template file). You can use PHP’s native get_included_files() to list all PHP source files loaded during request and narrow it down to your theme. Note that for more complex themes this will have not only … Read more

Editor role cannot save custom theme options

There’s a bug(ish) report regarding this here: http://make.wordpress.org/themes/2011/07/01/wordpress-3-2-fixing-the-edit_theme_optionsmanage_options-bug/ You can use a filter to modify the theme page capability. First you’ll want to edit your register_setting() calls to look like this: register_setting( ‘map-options’, ‘map_zoom’ ); register_setting( ‘map-options’, ‘map_longitude’ ); register_setting( ‘map-options’, ‘map_latitude’ ); The first parameter is the settings group and this is what we’re … Read more