Calendar Not Displaying via Shortcode

HomeForumsVolunteer Sign Up Sheets Calendar DisplayCalendar Not Displaying via Shortcode

Viewing 4 reply threads
  • Author
    Posts
    • #28357
      Dawn Moseke
      Participant

      I have attempted to place the calendar on this page in the second column: http://azpack329.org/

      I am not getting any errors saying that the calendar is not recognized and it looks to be outputting HTML but not data.

      Any ideas for how to fix this?

    • #28359
      Stephen Sherrard
      Keymaster

      Did you get this figured out?

      I went to your site and on the page you linked to, it said no matching calendar found, which means that you didn’t specify a valid calendar — as stated in the documentation:

      You MUST specify a calendar to display with the calendar argument. You can use either the numerical ID, or the title, of the calendar you want to display. For example, if you created a calendar that you titled “Main Volunteer Calendar”, the shortcode should look like the following:

      [pta-calendar calendar=”Main Volunteer Calendar”]

      But, I clicked on your Volunteer link in your main menu, and the View & Signup link for one of those took me to the calendar, which was showing your events, so the calendar is working just fine. Note also that any Calendars you create are actually a custom post type, so you can link directly to those posts (or put in in your menu) to display the calendar. You don’t need to use the shortcode.

    • #28459
      Dawn Moseke
      Participant

      I did not realize that you had responded or that I needed to subscribe to get alerts to a question I wrote. Sorry

      The calendar I created is called “Snack Bar”. The shortcodes I tried are [pta-calendar calendar=”snack bar”] and [pta-calendar calendar=”snack-bar”]. Shouldn’t this work by the definition of the shortcode.

      You mention in the last paragraph that I don’t need a shortcode. My goal is to display this calendar on the homepage of my website. How can I best accomplish this?

      I have combed through your documentation and if the answer is there, I am not understanding it. Thank you.

      • This reply was modified 5 months, 1 week ago by Dawn Moseke.
    • #28462
      Stephen Sherrard
      Keymaster

      I visited the page again, and the “no matching calendar” message is gone, meaning you have the shortcode correct.

      I can inspect your page and view the source, and I can see that the shortcode is correctly outputting all the html elements needed for the calendar to work, but the calendar javascript and CSS files are not getting loaded on your home page, so you’re not seeing anything.

      In order for the js and css files to load, my plugin needs to be able to detect that the shortcode is present in the page content. I’m following the correct programming standards of only outputting js and css on pages where they are needed, instead of globally loading those on your entire site (which causes bloat/slowdown and can conflict with other plugins).

      Looking at the HTML on that page, it appears you may be using some kind of page builder to design your pages. Some of those present the content to WordPress a bit differently, and thus when my plugin uses the WordPress function that checks if the content contains a certain shortcode, it returns a false value since the page builder is altering the content in its own way.

      If you are using some kind of page builder or block editor for your home page, try using a RAW HTML block to add the shortcode to a section, and see if that helps. You can also try creating another test page somewhere else on your site without using your page builder (use the classic editor) and try the shortcode there. If you then see it on that page, then at least you know it’s something with the page builder you’re using that’s most likely causing the shortcode to not get detected properly.

      The other possibility would be if your home page is not really a “page” or “post” that you can see in the list of pages on your admin side. If your theme is doing something unique for the home page, then my plugin won’t find the shortcode in the content if that page is not something that’s saved in the regular wp_posts table.

      If you want me to look into this further, you would need to email me privately with temporary admin level access so I can take a closer look at how your home page is setup.

      Also, regarding notifications, you need to check the box “Notify me of follw-up replies via email” before you click on the Submit button, or you can also later click on the “Subscribe” text link next to the breadcrumbs display under the thread title to subscribe to the whole thread.

    • #28468
      Dawn Moseke
      Participant

      Thank you Stephen. I was using an element that says it was HTML friendly, but I was able to modify it a bit and now it works. Thank you for your help 🙂

Viewing 4 reply threads
  • You must be logged in to reply to this topic.