Skip to content

Commit

Permalink
Option to change the visual width of media content within posts and p…
Browse files Browse the repository at this point in the history
…ages instead of hardcoded in functions.php
  • Loading branch information
Frumph committed Dec 30, 2013
1 parent b31e936 commit 7914bb8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
12 changes: 5 additions & 7 deletions functions.php
Expand Up @@ -235,12 +235,9 @@ function comicpress_sidebars_disabled() {
}

global $content_width;
if ( ! isset( $content_width ) ) {
if (comicpress_sidebars_disabled()) {
$content_width = 720;
} else {
$content_width = 520;
}
if (!isset($content_width)) {
$content_width = comicpress_themeinfo('content_width');
if (!$content_width) $content_width = 500;
}

if (!function_exists('comicpress_display_social_icons')) {
Expand Down Expand Up @@ -373,7 +370,8 @@ function comicpress_load_options() {
'menubar_social_deviantart' => '',
'menubar_social_myspace' => '',
'menubar_social_email' => '',
'enable_jetpack_infinite_scrolling' => false
'enable_jetpack_infinite_scrolling' => false,
'content_width' => 500
) as $field => $value) {
$comicpress_options[$field] = $value;
}
Expand Down
3 changes: 2 additions & 1 deletion options.php
Expand Up @@ -173,7 +173,8 @@ function comicpress_admin_options() { ?>
'custom_image_header_width',
'custom_image_header_height',
'archive_display_order',
'excerpt_or_content_in_archive'
'excerpt_or_content_in_archive',
'content_width'
) as $key) {
if (isset($_REQUEST[$key]))
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
Expand Down
18 changes: 18 additions & 0 deletions options/general.php
Expand Up @@ -49,6 +49,24 @@
</td>
</tr>
</table>

<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Content Width','comicpress'); ?></th>
</tr>
</thead>
<tr>
<?php if (!isset($comicpress_options['content_width'])) $comicpress_options['content_width'] = 500; ?>
<th scope="row"><label for="home_post_count"><?php _e('How wide do you want the media and images content to appear in posts and pages?','comicpress'); ?></label></th>
<td>
<input type="text" size="4" name="content_width" id="content_width" value="<?php echo $comicpress_options['content_width']; ?>" />
</td>
<td>
<?php _e('This sets a specific width for WordPress to use for media content within your posts. Default = 500','comicpress'); ?>
</td>
</tr>
</table>

<table class="widefat">
<thead>
Expand Down

0 comments on commit 7914bb8

Please sign in to comment.