Forum Replies Created
-
AuthorPosts
-
April 18, 2013 at 9:37 am in reply to: Help with WP_Query: How do I display a simple list of events? #46238
Jonah
ParticipantHey blogjunkie,
You can use this sample code to get you started: https://gist.github.com/jo-snips/5112025
You’ll need to build in pagination and customize other things yourself though.
I hope that helps!
– Jonah
Jonah
ParticipantHi Gordon,
If you wanted to embed the calendar this way in a given page, you would want to put the code in your theme’s page.php template file and typically along with a page conditional (since page.php is used for all pages) like so:
if(is_page('your-page-slug') {
include(‘wp-content/plugins/the-events-calendar/views/gridview.php’);
}
Does that help?Jonah
ParticipantHi Sean,
Do you mean that when you are in an event category, the query is not honoring only showing events in the feed for that category? You probably need to modify the query to check if you are on a taxonomy archive (http://codex.wordpress.org/Function_Reference/is_tax) and then pass in an argument for that particular tax.
Jonah
ParticipantNo problem Jeff, let us know if you need anything else.
– Jonah
Jonah
ParticipantHi Sean,
It would be helpful to get some examples of code you’re working with. You can share code here via http://snippi.com/
tribe_get_events() and query_posts() both kind of do the same thing – they query for posts – so I don’t think you’d really want to use them together. Typically if you need to modify a query, you want to use pre_get_posts() (http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts)
Does that help?
Jonah
ParticipantHi Jeff,
You do need to first run a query to return the records you are looking for and then you can access all the information for those records. get_posts() will do it but WP_Query is generally a better way: http://codex.wordpress.org/Class_Reference/WP_Query
So, you’re pretty much doing it the way you should but you may want to use WP_Query instead.
I hope that helps,
JonahJonah
ParticipantHi Jeffrey, I’m going to move this to the Community Events forum where someone will help you there. Stay tuned.
Jonah
ParticipantHi Christina,
You can put this code in your themes functions.php file:
add_action( 'pre_get_posts', 'exclude_events_category' );
function exclude_events_category( $query ) {if ( $query->query_vars['eventDisplay'] == 'upcoming' || $query->query_vars['eventDisplay'] == 'past' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'slug',
'terms' => array('2012'),
'operator' => 'NOT IN'
)
)
);
}return $query;
… just change the ‘2012’ in terms to whatever the slug of the category you want to exclude is.That should do it!
Jonah
ParticipantHi Jeff,
Just do a search for CSS sprites, there’s tons of articles out there on it. Here’s a pretty good one: http://css-tricks.com/css-sprites/
I hope that helps!
Jonah
ParticipantGreat Jon, I’m going to close this out but if you need anything else, please let us know.
Thanks,
JonahJonah
ParticipantHi Mike, that sounds great. This would actually be a really helpful modification for others I’m sure. Unfortunately we just don’t have the resources right now to write something up on it. If you come up with anything, it’d be great to see it shared!
Thanks,
JonahJonah
ParticipantHi Joel,
Sounds good and no worries. I’m glad you got it all figured out. If there’s anything else you need help with, please let us know!
Thanks,
JonahApril 17, 2013 at 8:11 am in reply to: Only display tribe_custom_fields() if there is a value #46073Jonah
ParticipantLooks good jkash23686, if you need anything else, just let us know!
Regards,
JonahJonah
ParticipantSounds good Jeffrey, let me know if there’s anything else you need help with.
Jonah
ParticipantGlad to be of service! Let us know if there’s anything else you need help with.
-
AuthorPosts
