[gnomeweb-wp] add support to the template get translated excerpt and make gnome-grass template fallback to default



commit eab870873967a29e58d904efc570b8d21639767c
Author: Vinicius Depizzol <vdepizzol gmail com>
Date:   Thu Feb 10 22:10:33 2011 -0200

    add support to the template get translated excerpt and make gnome-grass template fallback to default content functions if wppo is not activated

 wp-content/plugins/wppo/wppo.php            |   13 +++++++++++++
 wp-content/themes/gnome-grass/functions.php |   19 ++++++++++++++++---
 2 files changed, 29 insertions(+), 3 deletions(-)
---
diff --git a/wp-content/plugins/wppo/wppo.php b/wp-content/plugins/wppo/wppo.php
index 815aad2..e061ef9 100644
--- a/wp-content/plugins/wppo/wppo.php
+++ b/wp-content/plugins/wppo/wppo.php
@@ -202,6 +202,19 @@ function wppo_get_the_title () {
   
 }
 
+function wppo_get_the_excerpt () {
+  global $post, $wpdb;
+  
+  $content = wppo_get_translated_data ('translated_excerpt');
+  
+  if ($content != false) {
+    return $content;
+  } else {
+    return $post->post_excerpt;
+  }
+  
+}
+
 function wppo_get_the_content () {
   global $post, $wpdb;
   
diff --git a/wp-content/themes/gnome-grass/functions.php b/wp-content/themes/gnome-grass/functions.php
index df4d086..7226000 100644
--- a/wp-content/themes/gnome-grass/functions.php
+++ b/wp-content/themes/gnome-grass/functions.php
@@ -72,10 +72,23 @@ function create_post_type() {
 }
 
 
-// WPML specific constants do ignore custom css
+if (!function_exists ('wppo_get_the_title')) {
+    function wppo_get_the_title () {
+        return get_the_title ();
+    }
+}
+
+if (!function_exists ('wppo_get_the_excerpt')) {
+    function wppo_get_the_excerpt () {
+        return get_the_excerpt ();
+    }
+}
 
-define('ICL_DONT_LOAD_NAVIGATION_CSS', true);
-define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
+if (!function_exists ('wppo_get_the_content')) {
+    function wppo_get_the_content () {
+        return get_the_content ();
+    }
+}
 
 
 // Beautify [galery] shortcode



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]