Browse Source

Messo il riassunto ai box-pagina, personalizzazioni mediante css ad entrambe le tipologie di box

gine 9 years ago
parent
commit
822cc48862
4 changed files with 71 additions and 1 deletions
  1. 4 1
      ai1ec_box.php
  2. 48 0
      css/sbea.css
  3. 10 0
      index.php
  4. 9 0
      page_box.php

+ 4 - 1
ai1ec_box.php

@@ -28,7 +28,10 @@ function set_ai1ec_limits( $limit, $query ) {
 
 add_filter('posts_orderby', 'set_ai1ec_orderby');
 function set_ai1ec_orderby($orderby) {
-	$orderby = $wpdb->ai1ec_events.start." ASC";
+	global $wpdb;
+	
+	$db_prefix=$wpdb->prefix;
+	$orderby = $db_prefix."ai1ec_events.start ASC";
 	return $orderby;
 }
 

+ 48 - 0
css/sbea.css

@@ -0,0 +1,48 @@
+/* Where e when nel box eventi*/
+div.cat-box-content li div.ai1ec-excerpt div.ai1ec-time strong, 
+div.cat-box-content li div.ai1ec-excerpt div.ai1ec-location strong{
+	display:none;
+}
+
+/* Font della data e del luogo dell'evento*/
+div.cat-box-content li div.ai1ec-excerpt div.ai1ec-time, 
+div.cat-box-content li div.ai1ec-excerpt div.ai1ec-location {
+	font-size:10px;
+}
+
+/* Titoli del primo box*/
+div.cat-box-content li h2.post-box-title {
+	font-size:16px;
+	font-weight: bold;
+}
+
+/* Titoli degli altri box*/
+div.cat-box-content li h3.post-box-title {
+	font-size:13px;
+	font-weight: bold;
+}
+
+/** I RIASSUNTI ***/
+/* Nascondo il riassuntono a tutti i box ... */
+div.cat-box-content li div.entry p {
+	display:none;
+}
+/*.. ma non al primo*/
+div.cat-box-content li.first-news div.entry p {
+	display:inline;
+}
+
+/* Grandezza del riassunto per le pagine */
+div.cat-box-content li div.entry  {
+	font-size:10px;
+	margin-top:1px;
+}
+/*.. ma non per il primo*/
+div.cat-box-content li.first-news div.entry {
+	font-size:12px;
+}
+
+/* mando a capo il continua a leggere*/
+div.cat-box-content li.first-news div.entry a.more-link {
+	display: block;
+}

+ 10 - 0
index.php

@@ -9,6 +9,7 @@ Author URI: http://ginex.indivia.net
 License: BSD(3-clause) Licence
 */
 
+/*Intercetto lo shortcode*/
 add_shortcode('sbea', 'sbea_inject_box');
 function sbea_inject_box($attrs){
 	if( is_home() &&
@@ -21,4 +22,13 @@ function sbea_inject_box($attrs){
 			get_ai1ec_box($attrs);
 		}
 	}
+}
+
+/*Carico il css personalizzato*/
+add_action( 'wp_enqueue_scripts', 'sbea_load_scripts' );
+function sbea_load_scripts($attrs){
+	if( is_home()) {
+		wp_register_style( 'sbea_css', plugins_url( 'css/sbea.css', __FILE__),false,true );
+		wp_enqueue_style( 'sbea_css' );
+	}
 }

+ 9 - 0
page_box.php

@@ -74,6 +74,9 @@ function get_page_box($attrs){ ?>
 							</div><!-- post-thumbnail /-->
 						<?php endif; ?>			
 						<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
+						<div class="entry">
+							<?php tie_excerpt_home() ?>
+						</div>
 					</li>
 					<?php endif; ?>
 				<?php endwhile;?>
@@ -122,6 +125,9 @@ function get_page_box($attrs){ ?>
 							</div><!-- post-thumbnail /-->
 						<?php endif; ?>			
 						<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
+						<div class="entry">
+							<?php tie_excerpt_home() ?>
+						</div>
 					</li>
 					<?php endif; ?>
 				<?php endwhile;?>
@@ -170,6 +176,9 @@ function get_page_box($attrs){ ?>
 							</div><!-- post-thumbnail /-->
 						<?php endif; ?>			
 						<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
+						<div class="entry">
+							<?php tie_excerpt_home() ?>
+						</div>
 					</li>
 					<?php endif; ?>
 				<?php endwhile;?>