Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1210991

    Hi!

    Solution with page contents works fine (https://kriesi.at/support/topic/header-and-sidebar/), but I can not use page content on an event site (I use The event calendar plugin).

    Is it possible to add page content on top of each event?

    Greetings!

    #1212216

    Hey bcerin,

    Thank you for the inquiry.

    Have you tried adding the page content directly in the default-template.php file of the events calendar plugin? You can also use a hook to insert additional content above the events’ content.

    add_action("ava_after_main_title", function() {
       if (is_singular("event")) {
           echo "something here";
       }
    });
    

    Best regards,
    Ismael

    #1213252

    No, I did not add the page content directly in the default-template.php. How can I do it?

    I have already downloaded this file, but I don’t know how to insert page content in this file.

    Thanks for the help!

    #1214532

    Hi,

    Thank you for the update.

    In the child theme folder, create a new directory called tribe/events/v2, copy the enfold > config-events-calendar > views > default-template.php file, then place it inside the new directory or the v2 folder. You can now add the modification in the template file.

    If you want to render the content of a particular page, use this snippet.

    $post = get_post(7752);
    $content = Avia_Builder()->compile_post_content( $post );
    echo $content;
    

    Replace 7752 with the actual ID of the page.

    Best regards,
    Ismael

    #1214623

    Thanks! I think we are closer to a solution.

    I created a folder, pasted code in the file, and move the new file in the folder. But now there is a big white space.

    I think I didn’t paste code on the right place?

    code

    #1216028

    Hi,

    Thank you for the update.

    What is inside the 3790 page? It looks like there is a slider there but it’s not rendering properly. Can we access the site? Please post the login details in the private field.

    Best regards,
    Ismael

    #1216041

    Inside the 3790 page is “header” made with fukkwidth Easy Slider.

    #1217603

    Hi,

    Thank you for the info.

    We edited the tribe template and move the page content inside the container_wrap element or div.

    
    <div class='container_wrap container_wrap_first main_color fullsize'>
                <?php
    				$post = get_post(3790);
    				 $content = Avia_Builder()->compile_post_content( $post );
    				 echo $content;
    			?>
    

    It is working properly now.

    Best regards,
    Ismael

    #1217668

    Thanks. Just one more thing. If code is added, a map of the event hides behind the left menu (look on the picture).

    Without code looks:

    Without code

    With code looks:

    With code

    I hope we will finally find a solution.

    Best regards

    #1218365

    Hi,

    We added this code in the functions.php file to move the event content inside the main container.

    // move container to main element
    function ava_script_events_container() {
        if ( wp_script_is( 'avia-default', 'registered' ) ) {
            wp_add_inline_script( 'avia-default', "(function($) {
    			$('.single-tribe_events #main + .container').appendTo('.single-tribe_events #main');
    })(jQuery);" );
        }
     }
     add_action( 'wp_enqueue_scripts', 'ava_script_events_container', 9999);
    

    Please don’t forget to remove the cache prior to checking the page.

    Best regards,
    Ismael

    #1218730

    Thanks a lot!

    I like your theme and much more your support.

    #1219062

    Hi,

    You’re very welcome! And thank you for the kind words. We’ll close the thread now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Page content on event page’ is closed to new replies.