Support » Theme: Twenty Seventeen » modification to image template (page)

  • I am using TwentySeventeen theme and the standard gallery view. My small changes to the theme is added in a child-theme.

    I have created some pages (not posts) with a photo gallery like this one: http://vang.nu/det-gamle-fiskerleje/postkort-fra-vang/

    When you click on an image the single image is presented and it is possible to read a small text and to write a comment.

    However, I would also like to add a link to next/previous image using:Function Reference/next image link.

    Where do I place the function?
    Do I need to make some additional coding more than this?:

     <div class="alignleft"><?php previous_image_link( 'thumbnail' ); ?></div>
     <div class="alignright"><?php next_image_link( 'thumbnail' ); ?></div>

    Is it necessary to make a new template or template parts? and how?

    Mikael Boldt

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Which template is being used on that individual image page? You should be able to find out using this plugin https://wordpress.org/plugins/what-the-file/

    template-parts/page/content-page.php

    Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yea so you could try tampering with this in your Child Theme. First replicate the folder structure:

    
    /wp-content/themes/childnamename/template-parts/page/
    

    And create a content-page.php file in there, using the same code as the file that’s in the parent theme.

    Make sure you have FTP access in case for syntax errors so that you can revert the change.

    I have copied content-page.php to my child theme, and I have added the 2 lines I earlier described.

    things works – 90%.

    I need some kind of if-loop or some other kind of way to differ when the theme is showing images. Because, when the page is not showing an image, the 2 added lines shows some random images.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘modification to image template (page)’ is closed to new replies.