It’s about time I stopped manually adding coupons to my site and I am now taking the necessary steps to integrate XML feeds into my monthly updates.
I’ve recently reacquainted myself with an old purchase of WP All Import that I had downloaded for some e-commerce sites I was working on. After playing around for a couple days I feel like I’ve been living in the dark ages.
In the process of implementing my Coupons.com XML feed to pull new coupons monthly I ran into a small issue that I needed to solve.
I wanted to end each post title with the current month and year.
For example:
$1.00 Off Energizer Coupons Printable November 2014
I plan to have the feed auto update through a cron job each month so I don’t have to manually go back and update the title every time it’s a new month in my WP All Import settings.
I emailed support and they helped point me in the right direction. Good job guys.
Here’s the basic steps to add a custom PHP date function to your import settings and/or options.
Step 1.
Basically they told me I could create a custom php function to call the month and year and drop in some code into my XML import template.
I would first need to add the line of code to my desired position in the WP All Import settings:
[my_custom_function({my_element[1]})]
Step 2.
Then I needed to add a custom function call to my WordPress themes functions.php file. At the very bottom right before the end php tag, ?>, I added the code they instructed plus my PHP echo that I modified from code I found here.
my_custom_function($x) {
// WP All Import add Month and Year to end of dynamic posts with $x
echo date('F Y');
}
Step 3.
Now it’s as simple as re-uploading your functions.php file and previewing your handiwork in your import panel.
There you have it. I was pleasantly surprised at how easy this was given that I had no idea how to do it before I started.
Once you have the custom function set up in your functions.php file you can add this code from above [my_custom_function({my_element[1]})] to any place in your import settings and options and it’ll pull the current month and date.
Hit me up with questions below.

Help Me Help You
If you're looking to build, buy or sell I want to know you. You might not know you need assistance right now, but after we talk I bet you'll feel differently. Drop your email address below and I'll personally reach out to see how I can help.
Want To Make Lots of Passive Income Online?
Get My Top Hack...Free!
All you need to do is...
You're In! We'll send you a welcome email with the link to the hack, but if you want faster access just click here.
We won't sell your information. Promise. We're all about honesty here.