diff --git a/css/styles.css b/css/styles.css index 242e864..0a6e794 100644 --- a/css/styles.css +++ b/css/styles.css @@ -529,7 +529,7 @@ footer .content li { list-style: none; } display: block; } .speaker > img { - width: 100px; +/* width: 100px; */ float: left; padding: 0.3em; background: #FFF; @@ -539,12 +539,11 @@ footer .content li { list-style: none; } margin: 0 1em 2em 0; } .speaker .icons { - position: absolute; - top: 125px; - left: 0; - font-size: 1.2em; + font-size: 0.8em; width: 122px; text-align: center; + display: inline-block; + margin: 0 0 0 0.1em; } .speaker .icons a { display: inline-block; @@ -643,4 +642,4 @@ a.button:hover { opacity: 0.8; } *********************************************/ .schdule { -} \ No newline at end of file +} diff --git a/footer.php b/footer.php index 0f8eb4c..580c779 100644 --- a/footer.php +++ b/footer.php @@ -9,19 +9,19 @@

-

+

'footer-schedule', 'items_wrap' => '%3$s
' )); ?>

-

+

'footer-others', 'items_wrap' => '%3$s
' )); ?>

-

+

'footer-followus', 'items_wrap' => '%3$s
' )); ?>

diff --git a/functions.php b/functions.php index d734b26..3177bc8 100644 --- a/functions.php +++ b/functions.php @@ -34,7 +34,7 @@ function sh_latest_posts($atts){ $result = '

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

'; - $news_args = array( 'category_name' => $cat, 'numberposts' => 3 ); + $news_args = array( 'category_name' => 'news', 'numberposts' => 3, 'lang' => of_get_lang() ); $news = new WP_Query( $news_args ); ob_start(); @@ -157,7 +157,7 @@ function create_sponsors_posttype() { register_post_type( 'sponsors', $args ); } -add_action( 'init', create_sponsors_posttype ); +add_action( 'init', 'create_sponsors_posttype' ); # Create a custom post type for Speakers @@ -200,7 +200,7 @@ function create_speakers_posttype() { register_post_type( 'speakers', $args ); } -add_action( 'init', create_speakers_posttype ); +add_action( 'init', 'create_speakers_posttype' ); # Create a custom post type for Tranportation @@ -219,22 +219,68 @@ function transportation_posttype() { } function openfest_home_page() { + if (empty($wp)) {return true;} ; return !($wp->query_vars['pagename']=='home' || $wp->query_vars['pagename']=='home-2'); } -add_action( 'init', 'transportation_posttype' ); -pll_register_string('Schedule','Програма'); -pll_register_string('Others','Други'); -pll_register_string('follow','Последвайте ни в:'); -pll_register_string('venue','Интерпред, София, България'); -pll_register_string('venue_w','Място'); -pll_register_string('sponsors_w','Спонсори'); -pll_register_string('time','1-ви и 2-ри ноември 2014 г.'); -pll_register_string('publishedon','Публикувано на'); -pll_register_string('by_w','От'); -pll_register_string('see_whole_news','виж цялата новина'); -pll_register_string('news','Новини'); +function of_get_lang() { + if (function_exists("pll_current_language")) + return pll_current_language('slug'); + else + return 'bg'; +} +function e_($word) { + if (function_exists("pll_e")) + return pll_e($word); + else + echo $word; +} + +function pn_get_attachment_id_from_url( $attachment_url = '' ) { + + global $wpdb; + $attachment_id = false; + + // If there is no url, return. + if ( '' == $attachment_url ) + return; + + // Get the upload directory paths + $upload_dir_paths = wp_upload_dir(); + + // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image + if ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) { + + // If this is the URL of an auto-generated thumbnail, get the URL of the original image + $attachment_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url ); + + // Remove the upload path base directory from the attachment URL + $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url ); + + // Finally, run a custom database query to get the attachment ID from the modified attachment URL + $attachment_id = $wpdb->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' ); + +if (function_exists("pll_register_string")) { + pll_register_string('Schedule','Програма'); + pll_register_string('Others','Други'); + pll_register_string('follow','Последвайте ни в:'); + pll_register_string('venue','Интерпред, София, България'); + pll_register_string('venue_w','Място'); + pll_register_string('sponsors_w','Спонсори'); + pll_register_string('time','1-ви и 2-ри ноември 2014 г.'); + pll_register_string('publishedon','Публикувано на'); + pll_register_string('by_w','От'); + pll_register_string('see_whole_news','виж цялата новина'); + pll_register_string('news','Новини'); +} ?> + diff --git a/header.php b/header.php index 28b9512..d142a0e 100644 --- a/header.php +++ b/header.php @@ -32,6 +32,6 @@
'; + echo ''; } ?> diff --git a/page-speakers.php b/page-speakers.php index 457b79c..aef4f36 100644 --- a/page-speakers.php +++ b/page-speakers.php @@ -1,23 +1,59 @@

Лектори

+ +
'speakers' ); + $speakers_args = array( 'post_type' => 'speakers', 'nopaging' => 'true', 'order' => 'ASC' ); $speakers = new WP_Query( $speakers_args ); if ( $speakers->have_posts() ) : while ( $speakers->have_posts() ) : $speakers->the_post(); ?> -
+ + + +
+ 'speakers', 'nopaging' => 'true', 'order' => 'ASC' ); + $speakers = new WP_Query( $speakers_args ); + + if ( $speakers->have_posts() ) : + while ( $speakers->have_posts() ) : $speakers->the_post(); + ?> +
+ + @@ -32,7 +68,7 @@ get_header(); ?> endif; ?>
- +