[Plugin: Events Manager] HOW TO: Display Multiple Category Images Per Event
-
I ask a lot of questions here so I thought I’d provide a how-to for a change.
I’ve seen a lot of posts asking how to display multiple category images when you have more than one per event.NOTE: THIS WILL REQUIRE EDITING THE PLUGIN FILES
But its pure copy / paste.STEP ONE: Edit Plugin File
go to the file:
plugins / events-manager / classes / em-event.php
approx line 1385
https://pastebin.com/XNDdVqWpIn between the case #_CATEGORIES / #_EVENTCATEGORIES
and the case #_EVENTTAGS
PASTE the above pastebin code (I’ve commented start and end of what you need – its only 6 lines)STEP TWO: Create Folder Structure
go to your template folder.
If you have not done so, create the following folder structure in the root of your particular theme:
{yourthemeroot} / plugins / events-manager / placeholders
(where each slash represents a sub-folder)STEP THREE: Copy Existing Placeholder File
Now copy the existing categories.php placeholder.
Located at: wp-content / plugins / events-manager / templates / placeholders / categories.php
Copy this file.
Paste it into your newly created folder structure above (the placeholder folder you created in YOUR THEME’s root.STEP FOUR: Rename Existing Placeholder File to match “case” created in step 1
(IMPORTANT: make sure this is in your theme root plugin events manager placeholder folder NOT IN THE ACTUAL PLUGIN’s FOLDER )
Rename your file FROM:
categories.php
TO:
categories_images.phpSTEP FIVE: Edit NEW Placeholder File
Change this line of code FROM:
<li><?php echo $EM_Category->output("#_CATEGORYLINK"); ?></li>
TO THIS:
<li><?php echo $EM_Category->output("#_CATEGORYIMAGE"); ?></li>
WHILE YOURE IN THERE: update the class name (for styling reasons)
… just add a -images so it looks like this:
<ul class="event-categories-images">
(see how all we did was add -images this will allow you to apply specific styles to just this piece.OKAY YOU’VE DONE IT – Now all thats left to do is – make it happen!!!
As you created the “case” in step one:
Call your newly created multiple categories images like so:
#_EVENTCATEGORIESIMAGES
- The topic ‘[Plugin: Events Manager] HOW TO: Display Multiple Category Images Per Event’ is closed to new replies.