Getting Divi, WooCommrece and Products Per Page Plugin to play nice

Whew, that’s a long title!

So I’m branching out into using the Divi theme a bit more.  It’s an OK theme, I probably haven’t explored all of it’s customizations enough, but it’s no Avada. 🙂  It’s nice though.

If you are using

Then here’s a tip.  It wont work…out of the box at least.  However after much searching I found a quick fix here.

Just add the code below to the functions.php file in your child theme (because you know to ALWAYS use a child theme, right?)

/* products per page with - this fixes it when using divi */
add_action( 'pre_get_posts', 'wppp_extra_filter', 30 );
function wppp_extra_filter( $query = false ) {
$query->set( 'posts_per_page', apply_filters( 'loop_shop_per_page', 12 ) );

And presto, it’s working!

Google Search Console Microdata

When running a site through Search Console, Google started crying and complaining that I didn’t have author or date micro data.  Boo frickin’ hoo! 😉

Anywho I search for a while, tried a few things and found this code that fixes it:

Add this to your functions.php in your CHILD theme (you better be using a child theme, mister!)

//code to make google search console happy about microdata
function add_atom_data($content) {
$t = get_the_modified_time('F jS, Y');
$author = get_the_author();
$title = get_the_title();
if (is_home() || is_singular() || is_archive() ) {
$content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
return $content;
add_filter('the_content', 'add_atom_data');

It’s here: