Hot answers tagged

2

Just put two and two together: <img src="<?php $bigimg = get_post_meta( $post->ID, 'bg_file', true ); echo wp_get_attachment_url( $bigimg ); ?>" srcset="<?php echo wp_get_attachment_image_srcset( $bgimg, 'medium' ) ?>" alt="" />


1

This question has been answered on Stack Overflow before: http://stackoverflow.com/a/14626254/844732 add_action( 'admin_head', 'check_page_template' ); function check_page_template() { global $post; if ( 'page-homepage.php' == get_post_meta( $post->ID, '_wp_page_template', true ) ) { // The current page has the foobar template assigned ...


1

You can remove dashboard widgets/metaboxes using the following action, wp_dashboard_setup: Example 1 function remove_dashboard_widgets() { global $wp_meta_boxes; $wp_meta_boxes['dashboard']['normal']['core'] = array(); $wp_meta_boxes['dashboard']['side']['core'] = array(); } add_action('wp_dashboard_setup', 'remove_dashboard_widgets', ...



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