Forum Replies Created
-
AuthorPosts
-
Stefano DottaMember
Bill,
Thank you for your answer and the link provided.
Actually the single-portfolio.php is a full-width page and has no sidebars.
Regards,
Stefano, an avid hiker from Switzerland.
http://www.twoswisshikers.net/Stefano DottaMemberHello Cemal,
I actually ran into the same issue a few days ago, when I started playing with the new tiled gallery from the Jetpack.
After some digging in the php files of the Jetpack plugin, I came across this function that defines the tiled gallery width to be used by default, if the variable $content_with is not defined or empty: (/wp-content/plugins/jetpack/modules/tiled-gallery/tiled-gallery.php)
public static function get_content_width() {
global $content_width;$tiled_gallery_content_width = $content_width;
if ( ! $tiled_gallery_content_width )
$tiled_gallery_content_width = 500;return apply_filters( 'tiled_gallery_content_width', $tiled_gallery_content_width );
}The theme I use on my site (News) defines a $content_with of 580px, according to this line found in the functions.php of the theme:
$content_width = apply_filters( 'content_width', 580, 430, 910 );Not sure where and when the two other values are used, but 910px it's actually the width of my content when I use a full page width, according to Firebug.
BTW, I have created a custom post type to display my galleries, following the tutorial provided by Brian from StudioPress.
I therefore "hard coded" the variable in my single-portfolio.php file and my galleries are now taking the whole page width.
$content_width=910;Not sure it follows the best practices in term of coding, but it works...
http://www.twoswisshikers.net/portfolio/jura-en-hiver/ (in French only)And by the way, on all other pages or posts, the content width is reverted back to 580px, I guess taking the value defined in the functions.php file.
Question:
Can somebody explain the purpose of the three content_width values defined in the functions.php file and how to use them in order to avoid doing any hard-coding?Many thanks in advance,
Stefano, an avid hiker from Switzerland.
http://www.twoswisshikers.net/ -
AuthorPosts