• Resolved Mandy Jones

    (@mandy-jones)


    Hi there
    Is it possible to change the image size on the attachment pages? They seem to default to quite a small size. The visitor has to click on the image to see the original size.

    I would like them to show on the attachment page as the original size.

    Example attachment page: https: // www. wildcatfamily .com / felidae-family-classification / felidae-lower-classifications/

    Please remove spaces – I have just formatted the link like this otherwise I get a lot of spam.

    Many thanks
    Regards
    Mandy

    • This topic was modified 7 years, 9 months ago by Mandy Jones.
    • This topic was modified 7 years, 9 months ago by Mandy Jones.
Viewing 2 replies - 16 through 17 (of 17 total)
  • Hey @mandy-jones,
    The free theme doesn’t have built-in styling/editing/adjusting for the attachment pages. So what you are seeing the from a default wordpress template in the core which outputs the medium size image by default.

    I’ll note that premium theme does add a template for this and outputs the full size: https://themes.kadencethemes.com/virtue-premium/split-content-wide/camera/

    With free, you can use a child theme and add in the changes though.

    Get a child theme here: https://www.kadencethemes.com/child-themes/
    Then create a php file named attachment.php and place that in your child theme.

    Inside the file add this:

    <?php 
    /* Attachment Page Content */
    ?>
    <div id="content" class="container">
        <div id="post-<?php the_ID(); ?>" class="row single-article kt-attachment-page">
            <div class="main <?php echo kadence_main_class(); ?>" id="ktmain" role="main">
                <?php while (have_posts()) : the_post(); ?>
                <article <?php post_class(); ?>>
                    <a href="<?php echo wp_get_attachment_url(get_the_ID());?>">
                        <?php echo wp_get_attachment_image( get_the_ID(), 'full' ); ?>
                    </a>
                    <header>
                        <a href="<?php echo wp_get_attachment_url(get_the_ID());?>">
                            <h1 class="entry-title" itemprop="name headline"><?php the_title(); ?></h1>
                        </a>
                        <?php get_template_part('templates/entry', 'meta-subhead'); ?>
                    </header>
                    <div class="entry-content clearfix" itemprop="description articleBody">
                        <?php the_content(); ?>
                    </div>
                    <footer class="single-footer">
                        <meta itemprop="dateModified" content="<?php echo esc_attr(get_the_modified_date()); ?>">
                    </footer>
                    <?php comments_template('/templates/comments.php'); ?>
                </article>
                <?php endwhile; ?>
            </div>

    I hope that helps, and sorry for the confusion. I think Hannah has been thinking you were just making your own page or something.

    Ben
    Kadence Themes

    Thread Starter Mandy Jones

    (@mandy-jones)

    Excellent thanks so much Ben, yes Hannah and I seemed to be going in circles ??

    I will try this out later in the week, I’m sure it will work, if I have any issues I will open a new ticket.

    I will close this for now.
    Regards
    Mandy

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Attachment image size’ is closed to new replies.