• Resolved kentnerd

    (@kentnerd)


    Hello,

    Is there a way to put the code that I have in the “list item format” section into a separate file, like a php file in my wordpress project folder? (similar to how we put custom functions in the “functions.php” file whenever we want to customize a plugin). I’m referring to the section under Appearance > Widgets > Available Widgets > Events > List Item Format (the place where you write the html to display the event content)
    Please see this image: https://ibb.co/5rVCWFq

    It seems pretty sloppy to put our code in that tiny little box because it’s not formatted for us. Additionally, the biggest issue for me was when I, somehow, lost all my original html code that I had put in there. I had to write it all over again which cost me time.

    I was thinking, is there a way we can write a shortcode for this?
    That is, I write my shortcode function (function listItemFormat()) in my home.php file, and in the list item format area, instead of writing all that html, I just write my shortcode, [listItemFormat]. Is this possible?

    • This topic was modified 5 years, 4 months ago by kentnerd.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    At the moment this is how it works for events listing widget however you can change the format when using shortcode or default events listing page under Events > Settings > Formatting > Events

    Thread Starter kentnerd

    (@kentnerd)

    Hi Angelo,

    I’m not sure I understand.
    Are you saying that I can put shortcode under Events > Settings > Formatting > Events ?

    I see quite a few places to put code. I’ve looked there and under “Events Page”, there is “Default event list format header”, “Default event list format”, and many others.

    Where do I put my shortcode? And will this shortcode be coming from my own wordpress files or how will this work?

    Thank you so much for your help.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Using Appearance > Widgets > Text Widgets; you can try something like

    [code]
    [events_list scope="future" format_header="<table>" format_footer="</table>" ]
    <tr>
    <td> #_EVENTNAME </td>
    </tr>
    [/events_list]
    [/code]

    *you might need to install another WordPress plugin to enable shortcode on text widgets

    I have been setting up my EM on a test site – to go to new site I copied these items into a text file. I find it simple enough for backup/restore purposes.
    Just a thought.

    Thread Starter kentnerd

    (@kentnerd)

    @angelo_nwl I’ll forgo the plugin as the site already has 1,000 (kidding; but there’s a lot). Thank you for your assistance.

    Thanks for the suggestion @martybabes, I actually saved it into a text file as well. Not my preferred method, but it’s a simple solution as you said, and it works as a backup.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can I put “list item format” in separate file’ is closed to new replies.