I am trying to pull the results of two different views using get_view_query_results():
$results = get_view_query_results( 28195 );
$amount = count($results);
$results-r = get_view_query_results( 34157 );
$amount-r = count($results-r);
if ($amount >= 1 || $amount-r) {
if ($amount >= 1 ) {
$args = array('title' => 'Home Page Events Listing');
echo render_view( $args );
}
if ($amount-r >= 1 ) {
$args-r = array('title' => 'Recurring Events Listing');
echo render_view( $args-r );
}
} else { ...
The code above is not working, can the get_view_query_results( ) function only be used once?
Thanks for your help,
Suzanne
Sorry, after posting my code I realized my error...a simple syntax issue...
$results = get_view_query_results( 28195 );
$amount = count($results);
$results_r = get_view_query_results( 34157 );
$amount_r = count($results_r);
if ($amount >= 1 || $amount_r >=1) {
if ($amount >= 1 ) {
$args = array('title' => 'Home Page Events Listing');
echo render_view( $args );
}
if ($amount_r >= 1 ) {
$args_r = array('title' => 'Recurring Events Listing');
echo render_view( $args_r );
}
} else { ...
You can't use a "-" when declaring a variable. I replaced the dashes with underscores "_".
Sorry to bother,
Suzanne