diff --git a/functions.php b/functions.php index f0a9142..d2abd54 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,6 @@ $ncat, 'label' => __('News', 'initfest') ); - + $result = '

'.$atts['label'].' | '.__('see all', 'initfest').'

'; - - + + $news_args = array( 'category_name' => 'news,news-bg', 'numberposts' => 6, 'lang' => of_get_lang() ); - $news = new WP_Query( $news_args ); + $news = new WP_Query( $news_args ); ob_start(); if ( $news->have_posts() ) : @@ -76,7 +75,7 @@ function sh_latest_posts($atts){
-
'; endwhile; @@ -86,9 +85,9 @@ function sh_latest_posts($atts){ $result .= ob_get_contents(); $result .='
'; ob_end_clean(); - + return $result; - + } @@ -96,9 +95,9 @@ function sh_latest_posts($atts){ function sponsors_shortcode() { $result= '

'.pll__('Спонсори').'

'; - + $sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand', 'nopaging' => 'true'); - $sponsors = new WP_Query( $sponsors_args ); + $sponsors = new WP_Query( $sponsors_args ); ob_start(); @@ -131,9 +130,9 @@ function sponsors_shortcode() { function partners_shortcode() { $result= '

'.pll__('Партньори').'

'; - + $sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand', 'nopaging' => 'true' ); - $sponsors = new WP_Query( $sponsors_args ); + $sponsors = new WP_Query( $sponsors_args ); ob_start(); @@ -163,12 +162,12 @@ function partners_shortcode() { } -# Create shortcode for transport methods +# Create shortcode for transport methods function transport_shortcode() { $result= '

'.pll__('Място').': '.pll__('VENUE_LOCATION').'

'; $transport_args = array( 'post_type' => 'transportation' ); - $transport = new WP_Query( $transport_args ); + $transport = new WP_Query( $transport_args ); ob_start(); @@ -177,13 +176,13 @@ function transport_shortcode() { ?>

-
get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) ); - + } - + return $attachment_id; } add_action( 'init', 'transportation_posttype' );