Skip to content
Theme Hybrid
·
WordPress Plugins and Themes

Primary

  • Exhale
  • Members
  • Blog
  • Support
  • Pricing

hybrid_set_content_width()

This function is used to set the global $content_width variable for themes. Themes always need to set this width because WordPress uses it for various media functions, especially with embeds on the front end of the site. $content_width makes sure elements don’t break out of your post content area.

The purpose of this function is to simply provide a quick wrapper for setting the width.

Parameters

hybrid_set_content_width( $width = '' );

This function takes in a single parameter of $width, which should be an integer. You set it to the width of your post content area.

Return values

This function returns no values.

Usage

This function should be used within your child theme setup function. The following example assumes your post content width is 600px.

hybrid_set_content_width( 600 );

Powered by the code of a maniac.

  • Subscribe
  • Facebook
  • Twitter
  • GitHub
  • WordPress.org