
Step 1: Open dashboard of WordPress
Step 2: Go to Appearance
Step 3: Go to theme file editor
Step 4: Open page.php file
Step 5: Search the main container/div/span etc in which post will display. For example, see this code of page.php file.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php get_header(); ?> <section id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', 'page' ); do_action( 'poseidon_after_pages' ); comments_template(); endwhile; ?> </main><!-- #main --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?> |
In this code, this is the main container
1 | <section id="primary" class="content-area"> |
Now, add this property for section.
style=”width: 100%;”
now my previous code will looks like
1 | <section id="primary" class="content-area" style="width: 100%;"> |
Final Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php get_header(); ?> <section id="primary" class="content-area" style="width: 100%;"> <main id="main" class="site-main" role="main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', 'page' ); do_action( 'poseidon_after_pages' ); comments_template(); endwhile; ?> </main><!-- #main --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?> |