Forums

[Plugin: NextGEN Gallery] nggallery.css link not written to header (9 posts)

  1. marcopolo
    Member
    Posted 2 years ago #

    Hi,

    NextGen performed well on my local server, but is dropping its stylesheet on my production server. For some reason the link to http://sitename.com/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0 is NOT being added to the page header.

    Otherwise, the unstyled plugin (in Thickbox mode) performs fine.

    So far I've spent three days on this problem without finding an answer. Any help would be appreciated.

    -- Marco

  2. Alex Rabe
    Member
    Posted 2 years ago #

    Look for wp_head() in your theme files (compare the default theme)

  3. jennsweb
    Member
    Posted 2 years ago #

    I think I am experiencing a related issue. I am trying to use Nextgen for a custom template theme and when I set the template for the pages using NGG to any other template than the one for the site's blog section (which needs to have a different header) the gallery appears but the images don't "work" as links to a viewer. How does Nextgen know which header template to load the JavaScript in? Is there a way to change it?
    Thanks for a great plugin! This issue is actually giving me a good lesson on how NGG actually works.

  4. szzsolt
    Member
    Posted 2 years ago #

    My custom template was missing wp_head() from header.php.

    Adding this line just before the <head...> tag in header.php solved the same problem for me:

    <?php wp_head(); ?>

  5. marcopolo
    Member
    Posted 2 years ago #

    Thanks for the suggestions.

    I ultimately fixed it with a low-tech hack: I added the missing styles from nggallery.css to my main theme stylesheet. Looks fine now.

    See the fixed gallery here:
    http://www.coastalsurvey.com/mag/album/

  6. itlinux
    Member
    Posted 2 years ago #

    probably the reason is because you have selected the style which is not the default. You should look and make sure that you have the correct one ngg_k2.css for example you can verify it by looking at your page and view the sources. Just my 2 cents

  7. johanl
    Member
    Posted 1 year ago #

    My guess is that something is being messed up when you export the database from your local environment into the production environment.

    Exactly the same thing happened to me when I did the opposite thing.. copied the database from my production environment to refresh the content of my test environment.

    I had a similar kind of problem with another plugin (cforms) when I regularly copied data between sites. The problem was solved when I switched to phpMyAdmin exports from mysqldump.

    Nextgen Gallery stores serialized objects in the options table (just like cforms does)

    Probably an encoding problem...

    /johan

  8. Lynn
    Member
    Posted 1 year ago #

    I had the same problem: The css file was not written to the header. I had to add it manually. Once I did that, another problem was also fixed: Gallery thumbnails were displayed in a vertical row that was just one thumbnail wide. Once I added this to the header.php file, the display returned to normal: '<link rel="stylesheet" href="http://www.mysite.com/wp-content/plugins/nextgen-gallery/css/nggallery.css" type="text/css" media="screen" />'.

    The problem occurred after a move to a new server, so maybe the database export/import was to blame.

  9. kesh
    Member
    Posted 1 year ago #

    szzsolt, that worked!! Thank you! Adding <?php wp_head(); ?> to the header.php file solved it.

Topic Closed

This topic has been closed to new replies.

About this Topic