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]})]

wp-all-import-month-year-template

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');
}

Should look like this…
functionphp-wp-all-import-dynamic-custom-date

Step 3.
Now it’s as simple as re-uploading your functions.php file and previewing your handiwork in your import panel.
wp-all-import-dynamic-php-date-preview

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

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.

You have Successfully Subscribed!

Tim Seidler

See how Tim wrote some stuff up there? You should do that too. Tim's mission is to take average people, force them to write about stuff they know, and then help make them successful beyond their wildest dreams. Easy peasy.

View all posts

What? A Real Person?!

Hello. I'm Tim. And I'm a real person.

Tim Seidler

I'm currently doing, done, or intending to do all the things I talk about on GNQ.

If you're lost, need help or want to talk to a real person about internet marketing I'm always up for a chat.

Reach Me Here

Websites For Sale

Sincere thanks for signing up. We'll email you new listings the moment they're offered for sale.

Want To Make Lots of Passive Income Online?Get My Top Hack...Free!

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.