Support

Home Forums Event Espresso Premium EE4 Links Using Blog Archive

EE4 Links Using Blog Archive

Posted: February 16, 2015 at 11:22 am

Viewing 16 reply threads


Christopher Barnard

February 16, 2015 at 11:22 am

Hi,

This is my first spin with EE4 having previously set up to use EE3. Due to time constraints, I’m not trying anything other than to style a standard installation.

The issue is where the event has links back to the application (for example in the event booking confirmation) they are using the theme’s default blog post template. I appreciate this is standard behaviour, but is there any easy way round it?

Here is the link to show the event appearing in the blog template:

goo.gl/yn7uOL

I hope that make sense to someone…

Her’s the registration link:

goo.gl/ST7Xzc

Thanks so much.

Chris

WP 4.1
E.E 4.6.6.p No Add Ons
Upgrade from E.E.3


Josh

  • Support Staff

February 16, 2015 at 11:42 am

Hi Christopher,

Event Espresso 4 uses the WordPress theme’s archive.php template to display the list of event posts. There are a few ways around this, and the simplest option involves modifying the theme’s archive.php template and find the parts of it that mention a blog.

Then you wrap those in a conditional like this:

<?php if ( ! is_post_type_archive ( array( 'espresso_events', 'espresso_venues' ) ) ) : ?>

/* blog style content that you do not want on event pages here */

<?php endif; ?>


Christopher Barnard

February 17, 2015 at 2:09 am

Thanks Josh,

My theme is using single.php in this case. At least this is where I’m seeing the issue.

If I do something like this though for the title for example:

<?php if ( ! is_post_type_archive ( array( 'espresso_events', 'espresso_venues' ) ) ) : ?>

<h2 class="blog-title"><?php _e('Events','framework'); ?></h2>

<?php endif; ?> 

And if I leave the h2 class statement in tact:

<h2 class="blog-title"><?php _e('Events','framework'); ?></h2>

…it just outputs the title twice.

Do I need to create an if/else statement to make it work.

Hope that makes sense.

Chris


Lorenzo Orlando Caum

  • Support Staff

February 17, 2015 at 10:54 am

Hi Christopher, if you are running short on time then another option would be to use CSS to hide the postmeta information and other elements on the page:

https://eventespresso.com/wiki/hide-certain-elements-event-espresso-pages-using-css/


Lorenzo


Christopher Barnard

February 17, 2015 at 11:00 am

Hi Lorenzo!

Yes I’ve already nuked the links with a bit of CSS. My issue is the page titles, that have to have a different title other than ‘blog’. Maybe they can be manipulated with some conditional CSS?

Chris


Lorenzo Orlando Caum

  • Support Staff

February 17, 2015 at 1:03 pm

Alright, I see the issue that you are running into. Is there a way to enable body classes for your theme?

That would allow removal of certain elements by using something like this:

.single-espresso_events h2.blog-title{display:none;}

Another option is to use a conditional (https://eventespresso.com/wiki/ee4-conditional-tags/) to load CSS on the single event pages like this:

function ee_hide_select_elements() {
if(is_espresso_event()) {
    ?>
    
    

--
Lorenzo


Christopher Barnard

February 27, 2015 at 3:18 am

Thanks Lorenzo!

Sorry for the delay – the only way I could get this to work whilst adding the code to the single.php is as follows:

<?php if(is_espresso_event()) {
    ?>
    <style type="text/css">
h2.blog-title{display:none;}
div#wrapper div#container div.container div#respond {display:none;}
div#wrapper div#container div.container div.post div.post-meta {display:none;}
</style>
    <?php
    }
?> 

This hides the necessary elements – but ideally I’d just want to change the header text. Which I still can’t do. Is there any way to combine any of the suggested fixes?

Chris


Dean

February 27, 2015 at 3:38 am

Hi,

Can you provide a link to an example post/event please? The links above go to a 404 page.


Christopher Barnard

February 27, 2015 at 3:51 am

Hi!

Here is the link to the event registration page.

This is the link that clients click from the email:

You see the header block is now missing. That’s because I’ve hidden it with the code above, but ideally it would be better with it in situ.

Hope that makes sense!?

Chris


Christopher Barnard

February 27, 2015 at 3:53 am

Sorry made a mess of that:

http://www.esconsulting.com.sa/event-list/

And

http://www.esconsulting.com.sa/events/test-event-please-do-not-book/


Tony

  • Support Staff

February 27, 2015 at 4:00 am

Hi Chris,

Both those links show 404 for me – http://take.ms/PPTPZ

Can you try flushing your permalinks.

Go to Settings -> Permalinks.

Make no changes and click ‘Save Changes’


Christopher Barnard

February 27, 2015 at 4:09 am

Hi Could you try now…

Chris


Tony

  • Support Staff

February 27, 2015 at 4:19 am

Same for all of the links provided.

Which permalink structure are you using?

Are you running any caching plugins?

Are you logged into the site currently? If you view those pages when logged out do you still see them? (You can use a Chrome Incognito window or FireFoz Private Session for example)


Christopher Barnard

February 27, 2015 at 11:28 am

Right sorry about that interlude, not only was I having server issues but the events were also set to private:

http://www.esconsulting.com.sa/event-list/

http://www.esconsulting.com.sa/?espresso_events=test-event-please-do-not-book

Code I was using as above…


Lorenzo Orlando Caum

  • Support Staff

February 27, 2015 at 1:15 pm

Hi, I don’t think its possible to dynamically set the event title there. However, an str replace could change the text from blog to something like event registration or some other static text.

Let us know if that would work for your needs.


Lorenzo


Christopher Barnard

March 4, 2015 at 1:11 am

Thanks Lorenzo – I just created a child theme and implemented it in correct way in the end!

Thanks for your help…

Chris


Dean

March 4, 2015 at 4:09 am

Glad you got it sorted Chris.

Viewing 16 reply threads

The support post ‘EE4 Links Using Blog Archive’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso