• Resolved youngtheold

    (@youngtheold)


    Trying out the “Bookit Calendar” plugin in a theme. I have its shortcode in a shortcode block on the page, and in the index.php file:

    <div class=’booking’ style=’margin-top: 120px;’><?php the_content() ?></div>

    within “the loop”. It does render, but is missing the categories that are supposed appear to the left of the calendar… just shows the heading “choose category”. If I switch to WP’s default twenty-twenty theme, it works fine.

    Have gone as far as to create a bare bones theme for testing… no javascript, an empty CSS file and a function.php file that only loads the CSS and adds ‘title-tags’ theme support… same result. What bit of magic am I missing here.

    I’ve also tried do_shortcode(‘[bookit]’) in place of get_content()… same result. If anyone can point me in the right direction, I would greatly appreciate it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,
    Thanks for reaching us here!
    What theme are using with the Bookit plugin? We do not have “booking” class & it is hard to say what is rendering as a loop in the index.php file on our side. Please follow the plugin manual since it behaves in the same way as it is explained in the manual. You can also check the demo site of the Bookit plugin to see how the shortcode [bookit] looks like.

    Best Regards

    Thread Starter youngtheold

    (@youngtheold)

    Hi,

    Thanks for the reply.

    Currently, I’m working with one that I’ve coded. It contains very little… an empty CSS file, no Javascript, and just these lines in the index.php file.

    <?php
    
    	$args = array(
    		'sort_column' => 'menu_order'
    	);
    	$sitePages = get_pages($args);
    
    	foreach ($sitePages as $page) {
    
    		if ($page->post_name == 'contact') {
    ?>
    			<div class='booking' style='margin-top: 120px;'><?php the_content() ?></div>
    <?php
    		}
    	}
    
    ?>

    I have the shortcode [‘bookit’] on a page with the slug “contact”. From the documentation, this is the shortcode for rendering the calendar with all of the options. I’ve entered some sample categories, services and employees, but still, with my minimal theme, the plugin only renders the calendar and the headings “Choose Category” and “Booking Appointment”. As mentioned, I’ve seen it rendered correctly using the WordPress twentytwenty theme, so please, I need to know what I’m missing.

    The <div> is just so I can apply CSS to it later.

    Thanks.

    Hello,
    Thanks for reaching us here!
    I am sorry but we do not support guiding you on how to change your scripts & CSS/PHP files since we provide answers for the plugin item-related topics, how to use our plugin or how to set up.
    Thanks for your understanding.

    Best Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘shortcode renders incorrectly in my theme’ is closed to new replies.