1

I'm currently learning wordpress development and I try to add pagination which displays a "older"/"newer post" link and the number of the current page at the bottom of the posts. I also try to change the thumbnail size to 200x200px and all images should be cropped.

Here is my current wordpress loop:

<main id="main">

        <?php 
        // the query
        $args = array('posts_per_page' => 10 );
        $the_query = new WP_Query( $args ); 

        ?>

        <?php if ( $the_query->have_posts() ) { ?>

            <!-- loop -->

            <?php while ( $the_query->have_posts() ) {

                        $the_query->the_post(); ?>
   <article id="post"> 

                <div id="thumbnail">

                    <?php
                    if ( has_post_thumbnail() ) { the_post_thumbnail(array( "class"=>"thumbnail")); } ?>

            </div>

           <h2><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>

           <div class="entry">

                <?php the_excerpt(); ?>

           </div>


   </article>


        <?php } } else { ?>
        <p><?php _e( 'Die Posts entsprechen leider nicht den Kriterien.' ); ?></p>
        <?php }  ?>

       <!-- end of the loop -->

       <?php wp_reset_postdata(); ?>

</main>

I tried various things to add a new image size but nothing worked for me.

It currently looks like that: http://prnt.sc/b3v88w I just want to scale it up from 150x150 to 200x200px.

2
  • 1
    Please edit your question: ask only only one question, open a second question for thumbnail problem.
    – fuxia
    Commented May 14, 2016 at 10:24
  • Since the thumbnail part has already an answer it might be better to post a new question for the pagination.
    – mantis
    Commented May 14, 2016 at 10:41

1 Answer 1

2

Try this in your functions.php file:

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 200, 200 );

Read More: http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size

2
  • Nothing changes, sorry.
    – Benedikt W
    Commented May 14, 2016 at 10:13
  • try 'the_post_thumbnail(thumbnail', array( 'class' => 'thumbnail' ))
    – mantis
    Commented May 14, 2016 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.