Help with query function get_calendar()

The line you quote doesn’t actually query any posts. It’s just a very general check if there are any posts at all ever. The issue with parts of WP core like this, is that WordPress is engineered to query sets of posts. Whenever said sets might get extremely large — it mostly has to abandon … Read more

Include custom table in query

Working code: <?php global $wpdb; $date = date(“Y-m-d”); $querystr = ” SELECT * FROM wp_posts JOIN wp_ftcalendar_events ON wp_posts.ID = wp_ftcalendar_events.post_parent WHERE wp_posts.post_status=”publish” AND wp_posts.post_type=”post” AND wp_ftcalendar_events.start_datetime >= ‘$date’ ORDER BY wp_ftcalendar_events.start_datetime ASC “; $pageposts = $wpdb->get_results($querystr, OBJECT_K); ?> <?php if ($pageposts): ?> <?php global $post; ?> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post); … Read more

Create a new post on a specified publish date via link?

Here is the solution I came up with! In my plugin functions: <?php function ficma_inline_script() { $datedata = explode(“-“, $_POST[‘date’]); $year = $datedata[0]; $month = $datedata[1]; $day = $datedata[2]; $newdate = date(“M d, Y”, mktime(0, 0, 0, $month, $day, $year)); ?> <script type=”text/javascript”> document.getElementById(“mm”).value = “<?=$month ?>”; document.getElementById(“cur_mm”).value = “<?=$month ?>”; document.getElementById(“hidden_mm”).value = “<?=$month ?>”; … Read more

Calendar month navigation in Ajax only working once

Your event target (#calender_section a) is replaced after refreshing the calendar. Because of the replacing, the event listener isn’t applied to the target anymore. You have to apply the event listener to a parent element which doesn’t get replaced (here it is #calendrier_wrapper) and use the selector parameter of on (see http://api.jquery.com/on/): $(“#calendrier_wrapper”).on(‘click’, ‘#calender_section a’, … Read more

Help wiht adding fullcalendar.io to a WordPress page

Figured it out! First I passed what Iceable suggested and also added moment script above, like so wp_register_script(‘moment’, “https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js”); wp_register_script( ‘fullcalendar’, “https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.js”, array( ‘jquery’ ), null, true); and then I edited JS like so jQuery(function ($) { $(‘#calendar’).fullCalendar({ }) }); And it showed up!

Changing link format from Calendar widget

The calendar widget doesn’t link to “each day’s post”. It’s linking to an archive page that lists all posts made on that date. Hence the /2019/08/01/ URL. If you click the post title (or “Continue Reading” or “Read More” link if there is one) you will be taken to the single post whose URL will … Read more