Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1000882

    Im trying to override this template single-events.php in my child theme.

    When i try using the enfold file structure and the events cal structure none seem to work in the child theme.

    I have added login and FTP.

    I have added one line of code under the php call for the_content()

    #1001252

    Hey acscreativenew,

    Try copying config-events-calendar folder to your child theme.
    Then add this php code in your child theme’s functions.php:

    define( 'AVIA_CHILD_BASE', get_stylesheet_directory() .'/' );
    define( 'AVIA_CHILD_EVENT_PATH', AVIA_CHILD_BASE . 'config-events-calendar/' ); 
    
    add_action('tribe_events_template', 'avia_events_tempalte_paths', 10, 2);
    	
    function avia_events_tempalte_paths($file, $template)
    {
    	$redirect = array('default-template.php' , 'single-event.php' , 'pro/map.php' );
    	
    	if(in_array($template, $redirect))
    	{
    		$file = AVIA_CHILD_EVENT_PATH . "views/" . $template;
    		
    		if( class_exists( 'Tribe__Tickets_Plus__Main' ) )
    		{
    			if( 'single-event.php' == $template )
    			{
    				$file = AVIA_CHILD_EVENT_PATH . 'views/single-event-no-mobile.php';
    			}
    		}
    	}
    	
    	return $file;
    }

    Then go modify default-template.php inside config-events-calendar > views folder.
    Hope this helps :)

    Best regards,
    Nikko

    #1002391

    Hi,

    So that worked but now all my styles are gone?

    • This reply was modified 6 years, 4 months ago by acscreativenew. Reason: Add Image Link
    #1002595

    Hi acscreativenew,

    I checked the code you changed and the styles are gone because some of the html tags/structure are removed which contains classes which are required for the styles defined in the css files to work properly.
    Can you tell us what you are trying to achieve? probably a screenshot or mockup would help us visualize it and try to help with the code.

    Best regards,
    Nikko

    #1002725

    Hi,

    Trying to do a couple things. I would just like to get access to add ACF to the page. I would like the single page that you guys have created but just want to add my own code to it. When I first started messing with this I was just trying to override your single-events page template that comes with enfold. If i could get that page working but add my own code within that page thats what I would be looking for.

    I dont really have anything to show for it. I was just want your template to load but the ability to add my own code and queries within it.

    Hope this helps. In short just looking for a basic template override using most of the same code that is already on the template that comes with enfold.

    Thanks
    -Dan

    #1003171

    Hi Dan,

    I think it’s possible, just copy the same code from default-template.php then integrate some acf codes and that should work.
    You might also need the conditional tags: https://codex.wordpress.org/Conditional_Tags

    Best regards,
    Nikko

    #1003311

    So I did this but still a no go it seems like.

    This is what I currently have in my child theme. (link below)
    When I put any extra code on any of those pages it does not show up. If i add the same code to the files within the parent enfold page it does show up. So it seems my child theme overrides are still not taking.

    #1003982

    Hi,

    If you want to edit the single-event template you need to edit the single-event-no-mobile.php. I tested it in your child theme folder by replacing:

    
    <?php the_title( '
    <h2 class="tribe-events-single-event-title summary entry-title">', '</h2>
    ' ); ?>
    

    with

    
    <?php echo '
    <h2 class="tribe-events-single-event-title summary entry-title">Test</h2>
    '; ?>
    

    and the output changed. The event title was replaced with “Test”.

    Best regards,
    Dude

    #1188540

    Hi Nikko,

    Is this a typo or should this stay spelled as is?

    add_action(‘tribe_events_template’, ‘avia_events_tempalte_paths’, 10, 2);

    Best regards,

    Steven

    #1188724

    Hi Steven,

    Just spell it as is for now.
    It’s clearly a wrong spelling in english but that’s the correct spelling of the function.
    Thanks for noticing it, We’ll report it to our dev team. :)

    Best regards,
    Nikko

    • This reply was modified 4 years, 10 months ago by Nikko.
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.