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:



WP + Contact Form 7 + Godaddy = Potential Headache

I’ve had a couple of sites that had problems getting emails from a CF7 form when sent to godaddy.

What has worked for me is this page, very last entry:


Cherry Framework Move Error Solved!

I had a WordPress site on the Cherry Framework and moved it and suddenly was getting errors and couldn’t get into the admin.

Found this solution that fixes it perfectly so I thought I’d share (hint…kill those cache files!)




Posting this one just because I had to look it up like 3 times in the last month.  In Dreamweaver I have lots of pages with an HTML tag but something different in the tag like this:
a bunch of stuff that doesn’t change BR549 and some more stuff that doesn’t change

where BR549 is different every time.

This is the RegEx to find it

a bunch of stuff that doesn’t change (.*?) and some more stuff that doesn’t change

This is where to play with it:


Woocommerce tricks

I’ve had my first in-depth experience with Woocommerce and this post helped, especially #19:


WordPress: List all PDFs, with a word filter

Author Chris Cummings    Category PHP, Wordpress     Tags

I would have really thought this already existed as a plugin.  I’ve seen the need for lots of churches but also for business sites.  For churches, they often want to list their weekly bulletins on their website.  If a plugin is out there for WP that will do this, I haven’t found it.

But thankfully WP treats media files as posts and has a way to search by type (PDF) so mashing up code from 2 or 3 places and throwing in some PHP magic I’ve written this.  You can put this in a function (as I have) or write a template with it.  In this example you can see at the top that the “$targetword” var is in there…thats the search term used to filter out PDFs that do not contain that word.  My thinking on this is that only PDF files that start with the word “bulletin” (or have that word in them, case insensitive in this instance) will show up.

You could fancy all of this up of course and write some ADMIN code for all of this and built a full plugin with shortcodes and rainbows and exploding pinatas…but I just went “quick’n’dirty” on it.  I will probably have to go back and look at sorting the query to get the order I need but this is a dang good start.  I think so anyway…

function get_attachment_files(){

//the "filter" word...will only show listings with this word in it.
$targetword = "bulletin";

//what we are searching for is basically everything with the type of PDF
$args = array(
    'post_type' => 'attachment',
	'post_mime_type' => 'application/pdf',
    'numberposts' => -1,
    'post_status' => null,
    'post_parent' => null

//get everything in an array
$attachments = get_posts($args);

//if there are results...
 if ($attachments) {

	//format as an ordered list
      "); foreach ($attachments as $post) { //get the post title $tpn = $post->post_title; //only show if the target "filter" word is in that result. if (stripos($tpn,$targetword) !== false) { echo ("
    • "); setup_postdata($post); the_attachment_link($post->ID); echo ("
"); } } echo (" "); } }

Box Shadow Inset on Input Field? Yes, please!

Author Chris Cummings    Category CSS     Tags

Can you put a CSS3 box shadow on an input field?  You can!  The only thing you have to do is to set a background color or transparent to the field: