Change Layout to Display Post Grid

Hi,

i’m using the sydney theme for my page www.weltenbummler-unterwegs.de

I try to change the layout of the displayed post grid on all pages and subpages ( home, categories, archive,…)

So i found only in three files the possibility to edit the post grid format

home.php
archive.php
index.php
`
I see that the normal layout is call through the command:
get_template_part( ‘content’, get_post_format() );

For my new post grid layout i got an echo statement:
echo do_shortcode(’[wpspw_post design=“design-19” limit=“10” grid=“1” show_author=“false” pagination=“true” show_date=“true” show_category_name=“true” show_content=“true” show_full_content=“true” image_height=“206”]’);

I try to replace get_template_part( ‘content’, get_post_format()); through the new echo statement, but it works not correctly.

How can i change the layout using such a echo statement for my post grid layout?

Code from home/index/archive.php:

	<?php if ( have_posts() ) : ?>

	<div class="posts-layout">
		<?php while ( have_posts() ) : the_post(); ?>

			<?php
			get_template_part( 'content', get_post_format() );				

			?>


		<?php endwhile; ?>
	</div>

		<?php the_posts_navigation(); ?>

	<?php else : ?>

		<?php get_template_part( 'content', 'none' ); ?>

	<?php endif; ?>

Hello there,

Thank you for reaching out to us here.

Have you tried to enable the masonry grid layout option in the Appearance > Customize > Blog options > Blog Layout?

Regards,
Kharis

Hi,
yes it test also these layout option. But i want to use more customized post layouts and bought a pro plugin (https://www.wponlinesupport.com/wp-plugin/blog-designer-post-and-widget/)

I use the plugin also on static pages as widget.There it’s no problem to add such a grid system. But i can’t use widgets to customize my home or archive page. So they send me an echo statement(first post) to embed it in the home/archive page.

But maybe i need to past the echo statement (which display the new post in different grid layouts) on a differnt place at these php files?

Or can i customize the startscreen or archive pages with widgets in the sydney theme?

Hello there,

You would need to edit home.php and archive.php files. In the home.php file, replace the entries loop code block which is started with <?php if ( have_posts() ) : ?> and closed with <?php endif; ?> with the shortcode. So it will look like this. For the archive.php will look like this.

However, I can’t guarantee it’ll completely working as you might expect. As shortcode is actually a piece of code to display macros in a single page or widget, not in the main loop.

Note that to retain the changes you applies in the template files, you have to do it in the child theme mode. You’ll need a copy of the two mentioned files in your child theme folder and edit in there. If you haven’t yet created any child theme, you can use our premade one.

Regards,
Kharis