-
-
Save damiencarbery/6dd9308906a7b7c19cc1f3be734296be to your computer and use it in GitHub Desktop.
<?php | |
// Copy to theme directory as home.php | |
// Display content archive in two columns using flexbox. | |
// By Damien Carbery, https://www.damiencarbery.com | |
// 29 September 2019 | |
add_action( 'wp_head', 'dcwd_flex_css' ); | |
function dcwd_flex_css() { | |
?> | |
<style> | |
.blog .flex { display: flex; flex-wrap: wrap; } | |
.blog article { flex-basis: 50%; } | |
</style> | |
<?php | |
} | |
// Add a div around the posts to apply flex styles to. | |
add_action( 'genesis_before_while', 'dcwd_open_flex_div' ); | |
function dcwd_open_flex_div() { | |
?> | |
<div class="flex"> | |
<?php | |
} | |
add_action( 'genesis_after_endwhile', 'dcwd_close_flex_div', 5 ); | |
function dcwd_close_flex_div() { | |
?> | |
</div> | |
<?php | |
} | |
// Show featured image before post title. | |
add_action( 'genesis_entry_header', 'dcwd_show_featured_image', 8 ); | |
function dcwd_show_featured_image() { | |
if ( has_post_thumbnail() ) { | |
the_post_thumbnail(); | |
} | |
} | |
// Just show post date, not author or comment info. | |
add_filter( 'genesis_post_info', 'dcwd_post_info' ); | |
function dcwd_post_info( $post_info ) { | |
return '[post_date]'; | |
} | |
// Remove the Filed and Tagged info. | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
//* Run the Genesis loop | |
genesis(); |
The first comment in the file says: Copy to theme directory as home.php
If you want to use it for a category archive then copy it to archive.php.
The first comment in the file says: Copy to theme directory as home.php
If you want to use it for a category archive then copy it to archive.php.
Does it, what line?
It said it up until 3 hours ago when I changed it to help Laura. (https://gist.github.com/damiencarbery/6dd9308906a7b7c19cc1f3be734296be/revisions)
I'll revert as the Template Name wasn't needed to fix the issue on her site.
It said it up until 3 hours ago when I changed it to help Laura. (https://gist.github.com/damiencarbery/6dd9308906a7b7c19cc1f3be734296be/revisions)
I'll revert as the Template Name wasn't needed to fix the issue on her site.
Thanks, I'll give it another try. Cheers.
Does not work or where is suppose to be pasted into what file?