Hello there,
Please try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.
.masonry-layout .hentry {
float: left;
}
If site cache applied, you’re required to flush it. Otherwise, the code addition won’t take any effect.
https://codex.ww.wp.xz.cn/I_Make_Changes_and_Nothing_Happens
Let me know how it goes.
Regards,
Kharis
Hi Kharis,
Tried your CSS code it made difference. Image alignment does work properly.
I think I worked out what’s happening. When you resize your browser window, the post summary elements will change their order sequence and the alignment works. Refresh the page and the post summary elements order sequence changes and the alignment does not work. There is something in your code that is changing order sequence of the post summary.
I have taken screen captures showing the behavior. I can email them to you.
URL: http://www.coolangattaseniors.com.au/latest-news/
Hello there,
Not sure if sharing email address would be accepted here. As this support forum can’t process direct image attachment, you can use file hosting service like Google Drive or Cloudup.com to upload your files, and share their links here.
Regards,
Kharis
Hi Kharis,
If rename masonry-init.js.disabled file in the “wp-content/themes/sydney/inc” folder, the alignment issue when refreshing Latest News page goes away. There is something in the JavaScript code that has change since the previous version of the Sydney theme.
Kind regards
I made a typo error.
Should be, if rename masonry-init.js.disabled file in the “wp-content/themes/sydney/js” folder, the alignment issue goes away. Just loose the cool effects of elements moving around the page.
Kind regards.
I found work around open Sydney theme functions.php file search for “masonary” and comment out the following lines:
/* if ( get_theme_mod(‘blog_layout’) == ‘masonry-layout’ && (is_home() || is_archive()) ) {
wp_enqueue_script( ‘sydney-masonry-init’, get_template_directory_uri() . ‘/js/masonry-init.js’, array(‘masonry’),”, true );
} */
This will stop the masonry-init.js file from calling masonary.min.js main file.
Kind regards
Hello there,
To exclude theme’s script from your site safely, you can use wp_dequeue_script() function.
To exclude the masonry-init.js file of Sydney theme, use this PHP code:
add_action( 'wp_print_scripts', 'sydney_child_dequeue_scripts', 999 );
function sydney_child_dequeue_scripts() {
wp_dequeue_script('sydney-masonry-init');
}
add it to your child theme‘s functions.php file or use functionality plugin like Code snippets. You should avoid editing the main theme’s files directly as they’ll be overwritten when you update the theme.
Regards,
Kharis
Hi Kharis,
I have added your code to my child theme functions.php file and it works. I reverted the parent theme functions.php file to the original code.
BTW, is there a way to increase the number of posts summaries on the home page. I know you can change it from 3 to 6 but this requires making changes to parent fp-latest-news.php file. I tried to do it in the child theme functions.php but hit a number of error messages so I gave up. I just have to remember to replace the fp-latest-news.php if the Sydney theme is updated. I know its not ideal.
Kind regards
Tony
Hello there,
From your site dashboard, go to Settings > Reading; then specify number of maximum posts on “Blog pages show at most” option.
Regards,
Kharis
Hi Kharis,
I had it set as 9999 in the readings settings which does not make any difference. The Latest News Post Summarizes by default is set to 3 in the fp-latest-news.php file.
Thank you anyway.
Tony
Hello there,
The alternative solution for it is to load the widget from child theme. So you can edit the code that belongs to your child theme without affecting any changes upon updating. I’ve written some steps for this, which you can follow here in this discussion.
Regards,
Kharis
Hi Kharis,
I have implemented the code with the above link.
I can display 6 latest news post summaries on the home page.
Thank you very much.
Tony
You’re welcome!
Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.
Regards,
Kharis