Merge branch 'master' of github.com:initLab/initfest

This commit is contained in:
Krasimir Tsonev 2014-10-13 08:21:44 +03:00
commit 7d68d128b9
5 changed files with 111 additions and 30 deletions

View File

@ -529,7 +529,7 @@ footer .content li { list-style: none; }
display: block; display: block;
} }
.speaker > img { .speaker > img {
width: 100px; /* width: 100px; */
float: left; float: left;
padding: 0.3em; padding: 0.3em;
background: #FFF; background: #FFF;
@ -539,12 +539,11 @@ footer .content li { list-style: none; }
margin: 0 1em 2em 0; margin: 0 1em 2em 0;
} }
.speaker .icons { .speaker .icons {
position: absolute; font-size: 0.8em;
top: 125px;
left: 0;
font-size: 1.2em;
width: 122px; width: 122px;
text-align: center; text-align: center;
display: inline-block;
margin: 0 0 0 0.1em;
} }
.speaker .icons a { .speaker .icons a {
display: inline-block; display: inline-block;

View File

@ -9,19 +9,19 @@
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3><?php pll_e('Програма')?></h3> <h3><?php e_('Програма')?></h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-schedule', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-schedule', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3><?php pll_e('Други')?></h3> <h3><?php e_('Други')?></h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-others', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-others', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3><?php pll_e('Последвайте ни в:')?></h3> <h3><?php e_('Последвайте ни в:')?></h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-followus', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-followus', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>

View File

@ -34,7 +34,7 @@ function sh_latest_posts($atts){
$result = '<section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3><div class="grid">'; $result = '<section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3><div class="grid">';
$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 ); $news = new WP_Query( $news_args );
ob_start(); ob_start();
@ -157,7 +157,7 @@ function create_sponsors_posttype() {
register_post_type( 'sponsors', $args ); register_post_type( 'sponsors', $args );
} }
add_action( 'init', create_sponsors_posttype ); add_action( 'init', 'create_sponsors_posttype' );
# Create a custom post type for Speakers # Create a custom post type for Speakers
@ -200,7 +200,7 @@ function create_speakers_posttype() {
register_post_type( 'speakers', $args ); register_post_type( 'speakers', $args );
} }
add_action( 'init', create_speakers_posttype ); add_action( 'init', 'create_speakers_posttype' );
# Create a custom post type for Tranportation # Create a custom post type for Tranportation
@ -219,10 +219,55 @@ function transportation_posttype() {
} }
function openfest_home_page() { function openfest_home_page() {
if (empty($wp)) {return true;} ;
return !($wp->query_vars['pagename']=='home' || $wp->query_vars['pagename']=='home-2'); return !($wp->query_vars['pagename']=='home' || $wp->query_vars['pagename']=='home-2');
} }
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' ); add_action( 'init', 'transportation_posttype' );
if (function_exists("pll_register_string")) {
pll_register_string('Schedule','Програма'); pll_register_string('Schedule','Програма');
pll_register_string('Others','Други'); pll_register_string('Others','Други');
pll_register_string('follow','Последвайте ни в:'); pll_register_string('follow','Последвайте ни в:');
@ -234,7 +279,8 @@ pll_register_string('publishedon','Публикувано на');
pll_register_string('by_w','От'); pll_register_string('by_w','От');
pll_register_string('see_whole_news','виж цялата новина'); pll_register_string('see_whole_news','виж цялата новина');
pll_register_string('news','Новини'); pll_register_string('news','Новини');
}
?> ?>

View File

@ -32,6 +32,6 @@
</nav> </nav>
<?php <?php
if(openfest_home_page()){ if(openfest_home_page()){
echo '<section class="banner cf"><img src="'.get_template_directory_uri().'/img/banner-'.pll_current_language('slug').'.png" alt="" /></section>'; echo '<section class="banner cf"><img src="'.get_template_directory_uri().'/img/banner-'.of_get_lang().'.png" alt="" /></section>';
} }
?> ?>

View File

@ -1,23 +1,59 @@
<?php <?php
/*
* Template Name: Speakers
*/
get_header(); ?> get_header(); ?>
<div class="separator"></div> <div class="separator"></div>
<section class="content grid"> <section class="content grid">
<div class="col-left"> <div class="col-left">
<h1 class="big">Лектори</h1> <h1 class="big">Лектори</h1>
<div class="grid members">
<?php <?php
$speakers_args = array( 'post_type' => 'speakers' ); $speakers_args = array( 'post_type' => 'speakers', 'nopaging' => 'true', 'order' => 'ASC' );
$speakers = new WP_Query( $speakers_args ); $speakers = new WP_Query( $speakers_args );
if ( $speakers->have_posts() ) : if ( $speakers->have_posts() ) :
while ( $speakers->have_posts() ) : $speakers->the_post(); while ( $speakers->have_posts() ) : $speakers->the_post();
?> ?>
<div class="speaker"> <div class="member col4">
<a href="#<?php the_title(); ?>">
<?php <?php
if ( has_post_thumbnail() ) { if ( has_post_thumbnail() ) {
the_post_thumbnail(); the_post_thumbnail(array(100, 100));
} else { } else {
?> ?>
<img src="img/speakers.jpg"> <img src="/img/speaker.jpg">
<?php
}
?>
<br>
<?php the_title(); ?>
</a>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
<?php
$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();
?>
<div class="speaker" id="<?php the_title() ?>">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail(array(100, 100));
} else {
?>
<img src="/img/speaker.jpg">
<?php <?php
} }
?> ?>
@ -32,7 +68,7 @@ get_header(); ?>
endif; endif;
?> ?>
</div> </div>
<?php # get_sidebar(); ?> <?php get_sidebar(); ?>
</section> </section>
<?php get_footer(); ?> <?php get_footer(); ?>