Josh-TWC
Forum Replies Created
-
yahodahan, If I understand you correctly, when you are displaying posts by category all posts are showing? Is this on your ‘Home’ or ‘blog’ page? Maybe a little more info would be helpful such as what page you are trying to edit and what page you are trying to view. and maybe a link?
Good work! I’m glad I took the time to post what I came up with so I could help you, and anyone else out. 🙂
I found the args in the file /wp-content/plugins/all-in-one-event-calendar/app/view/admin/class-ai1ec-agenda-widget.php
They are:$default = array( 'title' => __( 'Upcoming Events', AI1EC_PLUGIN_NAME ), 'events_per_page' => 10, 'show_subscribe_buttons' => true, 'show_calendar_button' => true, 'hide_on_calendar_page' => true, 'limit_by_cat' => false, 'limit_by_tag' => false, 'limit_by_post' => false, 'event_cat_ids' => array(), 'event_tag_ids' => array(), 'event_post_ids' => array(), );The easiest way to find the cat or tag IDs is to go to your wp dashboard Events -> categories/tags and HOVER over a cat/tag name (if the link pops up in the status bar of your browser) or right click and copy link. In that URL there will be an http://*******_ID=xx(09, 47, 23 whatever) the number is what you have to use in your array to limit the category(ies).
Hope that helps!
I have this working, so far. What I did was put this php inside an Enhanced Text Widget I’m no expert, it took my all night to work this out, and I’m sure the code is ugly, but it’s working. If it’s not right maybe someone could fix it up for others to use.
On specific pages and posts I use custom fields (winery, wineryID) to determine the content of the widget. There may be an easier/better way to achieve this…
<?php $limit = 'False'; $per_page = '8'; $winery = ''; $wineryID = ''; $upcoming = 'Upcoming'; $winery = get_post_meta( get_the_ID(), 'winery', true ); if ( $winery != '' ) { $wineryID = get_post_meta( get_the_ID(), 'wineryID' ); $upcoming = 'Upcoming '; $limit = 'True'; $per_page = '4'; } $args = array( 'title' => $upcoming.$winery.' Events', 'events_per_page' => $per_page, 'show_subscribe_buttons' => false, 'show_calendar_button' => false, 'hide_on_calendar_page' => true, 'limit_by_tag' => $limit, 'event_tag_ids' => $wineryID, ); the_widget('Ai1ec_Agenda_Widget', $args); ?>I seem to have got this to work. I put this code in index.php (where i want ALL posts to display) for my theme directly under
<div id="content" role="main">:<?php // set the $paged variable $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // query the posts of your custom post types query_posts( array( 'post_type' => array( 'post', 'ai1ec_event' ), 'paged' => $paged ) // for paging links to work );?>And I got the info from here:
http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/I second this motion.