Title: Error message when adding alignwide for full width
Last modified: September 24, 2018

---

# Error message when adding alignwide for full width

 *  Resolved [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * (@memerunner)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/)
 * I’m trying to add alignwide capabilities according to the directions here.
    [https://richtabor.com/gutenberg-image-alignments/](https://richtabor.com/gutenberg-image-alignments/)
 * I’ve added the following code after localization is set:
    `function genesis_sample_localization_setup(){
   add_theme_support( ‘align-wide’ ); } add_action( ‘after_setup_theme’, ‘genesis_sample_localization_setup’)
 * However, I’m getting the following Error message:
    “Your PHP code changes were
   rolled back due to an error on line 35 of file wp-content/themes/genesis-sample-
   1/functions.php. Please fix and try saving again.
 * Cannot redeclare genesis_sample_localization_setup() (previously declared in 
   wp-content/themes/genesis-sample-1/functions.php:28)”
 * I’m assuming I don’t have the right parameter name where I’m entering “genesis_sample_localization_setup”,
   but can’t find anything else likely in my functions.php file.
 * Any help on this greatly appreciated.
    thx doug
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-message-when-adding-alignwide-for-full-width%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * (@clorith)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10758270)
 * Hiya,
 * This indicates that the function name has been used before, try something like
   this instead:
 *     ```
       function wp4327894732890_align_wide() {
           add_theme_support( ‘align-wide’ );
       }
       add_action( ‘after_setup_theme’, ‘wp4327894732890_align_wide’ )
       ```
   
 *  Thread Starter [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * (@memerunner)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10768326)
 * Thanks, Marius. Appreciate your input.
 * So it sounds like the function name “wp4327894732890_align_wide” is arbitrary,
   and just needs to match the parameter in the add_action function?
 * I tried using the following code:
 *     ```
       // Add 'alignfull'
   
       function arrovox_align_wide() {
       add_theme_support( ‘align-wide’ );
       }
       add_action( ‘after_setup_theme’, ‘arrovox_align_wide’)
       ```
   
 * However, when I tried to update the functions.php file, I received the following
   error message:
 * > Your PHP code changes were rolled back due to an error on line 41 of file wp-
   > content/themes/genesis-sample-1/functions.php. Please fix and try saving again.
   > syntax error, unexpected ‘require_once’ (T_REQUIRE_ONCE)
 * This is the code on line 41.
    `require_once get_stylesheet_directory() . '/lib/
   helper-functions.php';`
 * When I remove all the Alignfull code references from above, I can update the 
   functions.php file fine.
 * Any idea what’s going on?
    thanks doug
    -  This reply was modified 7 years, 8 months ago by [MemeRunner](https://wordpress.org/support/users/memerunner/).
 *  Moderator [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * (@clorith)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10769330)
 * Hi,
 * I see that some fancy quotes are being added somehow, try typing it manually,
   instead of copy-pasting, and see if it works better for you then 🙂
 *  Thread Starter [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * (@memerunner)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10772707)
 * Thanks, Marius, but typed it in by hand, and still getting the same error message:
 * > Your PHP code changes were rolled back due to an error on line 39 of file wp-
   > content/themes/genesis-sample-1/functions.php. Please fix and try saving again.
   > syntax error, unexpected ‘require_once’ (T_REQUIRE_ONCE)
 * Line 39 of functions.php is:
    `require_once get_stylesheet_directory() . '/lib/
   helper-functions.php';`
 * When you mention you’re seeing additional quotes, I’m not seeing any difference
   between what you wrote and my version. Can you tell me what quotes you’re referring
   to?
 * thanks
    doug
 *  Moderator [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * (@clorith)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10777228)
 * I’ve typed it out anew, let’s see if this one works better 🙂
 *     ```
       function wp4327894732890_align_wide() {
           add_theme_support( 'align-wide' );
       }
       add_action( 'after_setup_theme', 'wp4327894732890_align_wide' );
       ```
   
 * Apologies for the extra work, obviously not our intention 🙂
 *  Thread Starter [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * (@memerunner)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10777874)
 * Thanks, Marius. Appreciate you clarifying that. And functions.php accepted it,
   so that was it!
 * I’ve added the CSS for .alignfull and .alignwide, and then entered the alignfull
   CLASS into the block additional CSS field. However the image is only extends 
   to the left edge. It just repositioned the image to the left edge.
    [http://eme.88b.myftpupload.com/](http://eme.88b.myftpupload.com/)
 * I’m sure it’s something about my .alignfull CSS calc, below, as I’m playing around
   with the values and getting various results, but haven’t been able to get the
   image to extend to both the left and right edges.
 * Can you tell what the problem might be?
 *     ```
       .entry-content .alignfull {
           margin-left  : calc( -100vw / 2 + 100% / 2 );
           margin-right : calc( -100vw / 2 + 100% / 2 );
           max-width    : 100vw;
       }
   
       .entry-content .alignwide {
           margin-left  : -100px;
           margin-right : -100px;
           max-width    : 1024px;
       }
       ```
   
 *  Moderator [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * (@clorith)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10778108)
 * Your `.alignfull` needs a `width` declaration as well, try a `width: auto;`.
 *  Thread Starter [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * (@memerunner)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10779779)
 * That was it. Fantastic. Thanks, Marius!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Error message when adding alignwide for full width’ is closed to new 
replies.

 * ![](https://ps.w.org/gutenberg/assets/icon-256x256.jpg?rev=1776042)
 * [Gutenberg](https://wordpress.org/plugins/gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenberg/reviews/)

## Tags

 * [alignwide](https://wordpress.org/support/topic-tag/alignwide/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [full-width](https://wordpress.org/support/topic-tag/full-width/)

 * 8 replies
 * 2 participants
 * Last reply from: [MemeRunner](https://wordpress.org/support/users/memerunner/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/error-message-when-adding-alignwide-for-full-width/#post-10779779)
 * Status: resolved