When uploading images to my wp articles they are not displayed properly. (Please take a look at attached photograph: The images have not the same dimensions even though I set them within admin panel to “full width”)
This is the - I think - relevant code in functions.php:
function myBlog_features() {
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_image_size('landscape', 400, 260, true);
add_image_size('portrait', 480, 650, true);
set_post_thumbnail_size(700, 700);
}
add_action('after_setup_theme', 'myBlog_features');
Do I have to use a different property than add_image_size
? PLease not: It is not about the featured image, the Title Picture of a blog article. My issues are related to images within the blog posts.
This is the code in single.php
<section class="main-wrapper">
<?php
while(have_posts()) {
the_post(); ?>
<article class="article main-article_single">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'full' );
}
?>
<h1 class="article-headline">
<?php the_title() ?>
</h1>
<p class="article-body">
<?php the_content(); ?>
</p>
</article>
</section>
Do I have to add here sth. like <?php if image …?>
?
But what would it be?
As always: Best and thank you!
Sven