Change content_width (no sidebar) and featured image
-
Hi, I’m running a child theme of Superhero (as recommended) and have modded it via the child function to select a ‘No Sidebar’ template via category. e.g.:
https://www.mutantpop.net/walk/2014/04/08/bourne-end-shiplake/
One problem I’m having though as you might be able to see with the featured image is the content width, I can only fix this by modding the main theme, which of course gets nuked by updates as I’ve just down now:
if ( ! isset( $content_width ) ) $content_width = 910; /* pixels */ /** * Adjust the content width for Full Width page template. */ function superhero_set_content_width() { global $content_width; if ( is_page_template( 'page-full-width.php' ) ) $content_width = 910; if ( is_post_template( 'single-nosidebar.php' ) ) $content_width = 910; } add_action( 'template_redirect', 'superhero_set_content_width' );
I’ve tried adding this to my child functions as ‘after_setup_theme’ action, but no joy. Is there a way of modding my child theme to override the content_width setting? It’s obviously needed during the setup somewhere…it also overrides any Settings > Media settings, they don’t seem to make a difference.
And yes it does work if I mod the main theme functions.php, but updates are going to be a pain with that…(btw I tried your CSS fix mentioned elsewhere…doesn’t work, not the 100% !IMPORTANT – guessing the PHP sets the max width of the featured image via content_width somewhere?
Thanks
Tim
- The topic ‘Change content_width (no sidebar) and featured image’ is closed to new replies.