• Resolved fabbaf

    (@fabbaf)


    Hey there,

    I activated archives in Events Manager settings and right now it is using my custom template for archive pages. But there are some parts missing. It is showing the_excerpt and post_thumbnail, but the_title is not showing up.

    How can I show the title of the event in my archive page?

    Thanks in advance

    Fabian

    (sorry for my bad English)

    • This topic was modified 6 years, 5 months ago by fabbaf.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Fabian,
    Another EM user here.

    Archive pages are always generated by your theme. So you need to check that to make adjustments.

    Thread Starter fabbaf

    (@fabbaf)

    Thanks for your fast reply.

    On my ‘normal’ archive page, everything is working fine (the_title is showing up), but it is not on the Events Archive Page. Unfortunately I don’t know where to make the adjustments to show the title of the event on my events archive page.

    Here is the relevant part from my php-file.

        <div <?php post_class('col-md-6 col-sm-12'); ?>>
            <div class="post-wrap row">
                <div class="col-12">  
                    <header class="post-header">
                        <?php
                        if ( 'post' === get_post_type() ) :
                            ?>
                            <div class="post-meta">
                                <?php wp_posted_on();	?><span> / </span><?php wp_posted_in(); ?>
                            </div><!-- .post-meta -->
                            <?php
                            the_title( '<h2 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
                            ?>            
                        <?php endif; ?>
                    </header><!-- .post-header -->
                </div><!-- .col-12 -->
    
                <div class="col-5 post-thumbnail">
                    <?php wp_post_thumbnail(''); ?>
                </div><!-- .post-thumbnail -->
    
                <div class="col-7 post-excerpt">
                    <?php the_excerpt(); ?>
                </div><!-- .post-excerpt -->
            </div><!-- .row -->
        </div><!-- #post-<?php the_ID(); ?> -->
    • This reply was modified 6 years, 5 months ago by fabbaf.
    Thread Starter fabbaf

    (@fabbaf)

    I wanted to avoid another custom php-file, but right now I added a custom archive-event.php where I changed this:

                    <header class="post-header">
                        <?php
                        if ( 'post' === get_post_type() ) :
                            ?>
                            <div class="post-meta">
                                <?php wp_posted_on();	?><span> / </span><?php wp_posted_in(); ?>
                            </div><!-- .post-meta -->
                            <?php
                            the_title( '<h2 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
                            ?>            
                        <?php endif; ?>
                    </header><!-- .post-header -->
    

    to this

                    <header class="event-header">
                    
                    <?php
                    global $post;
                    $EM_Event = em_get_event($post->ID, 'post_id'); 
    
                    echo $EM_Event->output('#_EVENTNAME');
                    ?>
    
                    </header><!-- .post-header -->
    

    Now the event names/titles are showing up.

    • This reply was modified 6 years, 5 months ago by fabbaf.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Archive Page – Missing Header / Custom archive template’ is closed to new replies.