Integration:WPG2 How To Create Custom Header - Gallery Codex
Personal tools

Integration:WPG2 How To Create Custom Header

From Gallery Codex

This Page Relates to WPG2 Version 3.0

With certain Wordpress Themes, particularly three column Wordpress themes, content is usually set to a smaller than a screen size width. Displaying Gallery2 content within these types of themes is often challenging because of the limitation of working with a limited/reduced width. One technique to help display Gallery2 Output in these situations, is to create an alternative Wordpress Header. This custom header will automatically be outputted only when displaying WPG2 Ouput, thus allowing you to stylise your Gallery2 Output by specifying a different stylesheet, different widths or even removing your wordpress sidebars help give your Gallery2 output some extra width.

How To create a your WPG2 Header

  1. Take a copy of your Wordpress theme's existing header.php file and rename it wpg2header.php.
  2. Revalidate WPG2.

Please See Wordress Using Themes For More Information regarding Wordpress Themes.

Changes in WPG2 3.0 to your WPG2 Custom Header

If you have an WPG2 Custom Header, created prior to WPG2 3.0 please remove the following..

  <?php if (isset($g2data['headHtml'])) { 
       list($g2_title, $g2_css, $g2_javascript) = GalleryEmbed::parseHead($g2data['headHtml']); 
       foreach ($g2_css as $css) { echo "$css \r\n"; } 
       foreach ($g2_javascript as $javascript) { echo "$javascript \r\n"; } 
  } ?> 

Failure to remove those lines will lead to blank WPG2 Output Page