Jump to content


Photo
- - - - -
Resolved

Styling custom post type from Events Manager?

event manager custom post type events

  • Please log in to reply
5 replies to this topic

#1 attac

attac

    Super Member

  • Members
  • 132 posts
  • Country: Country Flag

Posted 09 October 2012 - 01:03 PM

I'm using Events Manager for events, and it works OK. There is just one issue, which is that I don't want to show post date on the Event page.

Example:

Please Login or Register to see this Hidden Content

(in Norwegian)
The event is on the 17th of October, but was posted the 9th of October. This causes some confusion to readers when both dates are visible.

I want to keep post dates on regular posts, but hide them on Events.

Event Manager shows Events as custom post types, and it seems like I'm able to use Pagelines drag-and-drop on the Events.php template.

So I figure that what I ought to do is editing the meta-information for events.php? Or use CSS to hide the post-date on events?

Any tips on how to do that?

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 09 October 2012 - 10:37 PM

If you apply display:none; to the element you want to hide, it won't show.

#3 attac

attac

    Super Member

  • Members
  • 132 posts
  • Country: Country Flag

Posted 10 October 2012 - 12:23 PM

What I need help with is how to do that only on Event-pages? How do I separate CSS for the event-pages from that on regular posts?

#4 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 10 October 2012 - 01:17 PM

Time for some WordPress 101 for search purposes then.

Three years ago WordPress added automatic body classes depending on what page you are viewing using the body_class() function.
This means themes/developers can easily target specific pages, for example every post will have a postid-nnn class added.

So lets look at the body tag of your events page:

Please Login or Register to see this Hidden Content


As we can clearly see the events plugin is inserting two clases for you single-event as its a single even page and event, Im guessing every event page would have this.

So to style something on that page, just start your css with .single-event

/lesson

#5 attac

attac

    Super Member

  • Members
  • 132 posts
  • Country: Country Flag

Posted 10 October 2012 - 01:34 PM

Thanks Simon.

#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 10 October 2012 - 09:46 PM

The topic was marked as resolved.





Also tagged with one or more of these keywords: Resolved, event manager, custom post type, events