• Resolved cudak888

    (@cudak888)


    I seem to be having an issue where MaxGalleria is using the page template off my blog to display its gallery (as a result, there is no gallery).

    I looked under settings, but I can’t change the drop-down for “Image Galleries” from Image Tiles. I’m not sure if this is the proper place to change it, but – if so – will MaxGalleria hook into a custom .PHP file from the theme’s directory? It’s a child theme and I’d much rather style the template in this manner.

    Do let me know.

    Thank you!

    -KK

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author AlanP57

    (@alanp57)

    MaxGaleria uses a template when display a gallery page. The template file is single-maxgallery.php that can be found in the plugins/maxgalleria. This file is also copied to your current theme folder when the MaxGalleria is activated or updated. It also deletes the template file from your theme when the plugin is deactivated. Now you can modify this template to correspond to the design of your site. You could make a copy of your theme’s page.php and rename it to single-maxgallery.php and from the original single-maxgallery.php copy these lines:

    <?php if ($post->post_type == MAXGALLERIA_POST_TYPE) { ?>
       <div class="mg-container">
         <h1 class="mg-title"><?php echo the_title() ?></h1>
           <?php echo do_shortcode('[maxgallery id="' . $post->ID . '"]') ?>
       </div>
    <?php } ?>

    and put them within the WordPress loop of your template file.

    Note that this file gets replaced whenever the MaxGalleria plugin is updated or it gets deleted when your theme is updated so make a backup copy of your modifed template file.

    Thread Starter cudak888

    (@cudak888)

    Dear Alan:

    Thank you so much.

    Now I know why the styling disappeared all of a sudden – in the midst of removing all the old files and keeping my local XAMPP copy synced with my live copy on FTP, I probably deleted the folder and template by accident – or during one of the many plugin deactivations I’ve performed.

    It’s unfortunate that the template file is deleted on every update though – that’s more or less what I was trying to avoid with FooGallery. Though, come to think of it, I could modify that code snippet you provided to point to a template of a completely different name in a different folder, e.g. <?php get_template_part( 'gallery', 'custommax' ); ?>.

    It’s just that I don’t want to risk losing the customized template during a routine update on the local site. Even with a backup, it’s isn’t that reassuring.

    -KK

    • This reply was modified 6 years, 9 months ago by cudak888.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing default page template?’ is closed to new replies.