Dave,
That’s an excellent idea. I have made a note to add the ability to insert conversion pixel codes into the front posts page / blog page the next time I have a chance to release an update. Yes, it would be the controlled by the home.php or index.php page template, depending on your theme.
If you want a quick and easy solution in the meantime, you can:
1. Paste the code below into a text editor (notepad on Windows, TextEdit on Mac, etc.) and replace the “PASTE CONVERSION PIXEL CODE HERE” text with the conversion pixel code you want to use.
2. Save the text file as “facebook-conversion-pixel-for-blog-page.php” and upload it to the wp-content/plugins folder on your website, where all the plugins live.
3. From the Dashboard, go to Plugins > Installed plugins and activate the plugin.
4. Let the good times roll! And, please give my plugin a 5 star review if you found it (and me) to be helpful ?? Thanks!
<?php
/*
Plugin Name: Add Facebook Conversion Pixel to Blog Page
Description: Add Facebook Conversion Pixel to Blog Page
Version: 1.0
Author: Kellen Mace
Author URI: https://kellenmace.com/
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
function fb_pxl_insert_code_on_blog() {
if ( is_home() ) {
$fb_pxl_code = “
PASTE CONVERSION PIXEL CODE HERE
“;
echo $fb_pxl_code;
}
}
add_action( ‘wp_head’, ‘fb_pxl_insert_code_on_blog’ );
?>