summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2015-05-01 00:40:49 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2015-05-01 00:40:49 +0000
commitc64ce3ae8de09092f9570ab88a68fe920b0fd970 (patch)
treea9959002055a8bdff0ee46bf82ca6a2a39bf00cd /themes/mantra/includes
parentAdd easy-table plugin, requested by hwoarang (diff)
downloadblogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.tar.gz
blogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.tar.bz2
blogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.zip
Update plugins and themes to the latest versions.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Diffstat (limited to 'themes/mantra/includes')
-rw-r--r--themes/mantra/includes/theme-frontpage.php171
-rw-r--r--themes/mantra/includes/theme-functions.php100
-rw-r--r--themes/mantra/includes/theme-loop.php2
-rw-r--r--themes/mantra/includes/theme-seo.php8
-rw-r--r--themes/mantra/includes/theme-setup.php5
-rw-r--r--themes/mantra/includes/theme-shortcodes.php10
-rw-r--r--themes/mantra/includes/theme-styles.php9
7 files changed, 149 insertions, 156 deletions
diff --git a/themes/mantra/includes/theme-frontpage.php b/themes/mantra/includes/theme-frontpage.php
index c832d49a..213545ec 100644
--- a/themes/mantra/includes/theme-frontpage.php
+++ b/themes/mantra/includes/theme-frontpage.php
@@ -7,8 +7,69 @@
* @subpackage Functions
*/
+if ( ! function_exists( 'mantra_frontpage_css' ) ) :
+function mantra_frontpage_css() {
+ $mantra_options= mantra_get_theme_options();
+ foreach ($mantra_options as $key => $value) { ${"$key"} = $value; }
+ ob_start();
+ echo '<style type="text/css">/* Mantra frontpage CSS */'; ?>
+<?php if ($mantra_fronthideheader) {?> #branding {display:none;} <?php }
+ if ($mantra_fronthidemenu) {?> #access {display:none;} <?php }
+ if ($mantra_fronthidewidget) {?> #colophon {display:none;} <?php }
+ if ($mantra_fronthidefooter) {?> #footer2 {display:none;} <?php }
+ if ($mantra_fronthideback) {?> #main {background:none;} <?php } ?>
+
+.slider-wrapper { display:block; float:none; width:100%; margin:0 auto; }
+
+#slider{
+ max-width:<?php echo $mantra_fpsliderwidth ?>px ;
+ height:<?php echo $mantra_fpsliderheight ?>px ;
+ margin:30px auto 20px; display:block; float:none;
+ border:<?php echo $mantra_fpsliderborderwidth.'px solid '.$mantra_fpsliderbordercolor; ?>; }
+
+#front-text1 h1, #front-text2 h1 { display:block; float:none; margin:35px auto; text-align:center; font-size:32px;
+ clear:both; line-height:32px; font-weight:bold; color:<?php echo $mantra_fronttitlecolor; ?>; }
+
+#front-text2 h1{ font-size:28px; line-height:28px; margin-top:0px; margin-bottom:25px; }
+
+#frontpage blockquote { width:88%; max-width:88% !important; margin-bottom:20px;
+ font-size:16px; line-height:22px; color:#444; }
+
+#frontpage #front-text4 blockquote { font-size:14px; line-height:18px; color:#666; }
+
+#frontpage blockquote:before, #frontpage blockquote:after { content:none; }
- if ( ! function_exists( 'mantra_frontpage_generator' ) ) :
+#front-columns > div { display:block; width:<?php
+switch ($mantra_nrcolumns) {
+ case 0: break;
+ case 1: echo "95"; break;
+ case 2: echo "45"; break;
+ case 3: echo "29"; break;
+ case 4: echo "21"; break;
+} ?>%; height:auto; margin-left:2%; margin-right:2%; margin-bottom:10px; float:left; }
+
+.column-image { height:<?php echo $mantra_colimageheight ?>px; border:3px solid #eee; }
+
+.theme-default .nivo-controlNav {margin-left:0;}
+<?php
+switch($mantra_fpslidernav):
+ case "Bullets": break;
+ case "Numbers": ?>
+.theme-default .nivo-controlNav {bottom:-40px;}
+.theme-default .nivo-controlNav a { background: none; text-decoration:underline; text-indent:0; }
+<?php break;
+ case "None": ?>
+.theme-default .nivo-controlNav { display:none; }
+<?php break;
+endswitch;
+ echo "</style>\n";
+ $mantra_presentation_page_styling = ob_get_contents();
+ ob_end_clean();
+ return $mantra_presentation_page_styling;
+} // mantra_frontpage_css()
+endif;
+
+if ( ! function_exists( 'mantra_frontpage_generator' ) ) :
// Front page generator
function mantra_frontpage_generator() {
$mantra_options= mantra_get_theme_options();
@@ -46,114 +107,6 @@ foreach ($mantra_options as $key => $value) {
});
</script>
-<style type="text/css">
-
-<?php if ($mantra_fronthideheader) {?> #branding {display:none;} <?php }
- if ($mantra_fronthidemenu) {?> #access {display:none;} <?php }
- if ($mantra_fronthidewidget) {?> #colophon {display:none;} <?php }
- if ($mantra_fronthidefooter) {?> #footer2 {display:none;} <?php }
- if ($mantra_fronthideback) {?> #main {background:none;} <?php } ?>
-
-.slider-wrapper {
-display:block;
-float:none;
-width:100%;
-margin:0 auto;
-}
-
-#slider{
- max-width:<?php echo $mantra_fpsliderwidth ?>px ;
- height:<?php echo $mantra_fpsliderheight ?>px ;
- margin:30px auto 20px;
- display:block;
- float:none;
- border:<?php echo $mantra_fpsliderborderwidth.'px solid '.$mantra_fpsliderbordercolor; ?>;
-}
-
-#front-text1 h1, #front-text2 h1{
- display:block;
- float:none;
- margin:35px auto;
- text-align:center;
- font-size:32px;
- clear:both;
- line-height:32px;
- font-weight:bold;
- color:<?php echo $mantra_fronttitlecolor; ?>;
-}
-
- #front-text2 h1{
- font-size:28px;
- line-height:28px;
- margin-top:0px;
- margin-bottom:25px;
-}
-
-#frontpage blockquote {
- width:88% ;
- max-width:88% !important;
- margin-bottom:20px;
- font-size:16px;
- line-height:22px;
- color:#444;
-}
-
-#frontpage #front-text4 blockquote {
- font-size:14px;
- line-height:18px;
- color:#666;
-}
-
-#frontpage blockquote:before, #frontpage blockquote:after {
- content:none;
-}
-
-#front-columns > div {
-display:block;
-width:<?php
-switch ($mantra_nrcolumns) {
- case 0:
- break;
- case 1:
- echo "95";
- break;
- case 2:
- echo "45";
- break;
- case 3:
- echo "29";
- break;
- case 4:
- echo "21";
- break;
-} ?>%;
-height:auto;
-margin-left:2%;margin-right:2%;
-margin-bottom:10px;
-float:left;
-}
-
-.column-image {
- height:<?php echo $mantra_colimageheight ?>px;
- border:3px solid #eee;
-}
-
-.theme-default .nivo-controlNav {margin-left:0;}
-
-<?php if ($mantra_fpslidernav!="Bullets") {
- if ($mantra_fpslidernav=="Numbers") {?>
-
-.theme-default .nivo-controlNav {bottom:-40px;}
-.theme-default .nivo-controlNav a {
- background: none;
- text-decoration:underline;
- text-indent:0;
-}
-<?php } else if ($mantra_fpslidernav=="None") {?>
-.theme-default .nivo-controlNav {display:none;}
-
-<?php } } ?>
-</style>
<div id="frontpage">
<?php
diff --git a/themes/mantra/includes/theme-functions.php b/themes/mantra/includes/theme-functions.php
index 3cdc2fe3..6698de72 100644
--- a/themes/mantra/includes/theme-functions.php
+++ b/themes/mantra/includes/theme-functions.php
@@ -75,10 +75,10 @@ add_action('wp_head','mantra_header_scripts',100);
function mantra_title_and_description() {
$mantra_options = mantra_get_theme_options();
foreach ($mantra_options as $key => $value) { ${"$key"} = $value; }
-
+
// Header styling and image loading
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
-
+
global $post;
if (get_header_image() != '') { $himgsrc = get_header_image(); }
@@ -120,7 +120,7 @@ function mantra_title_and_description() {
if ($mantra_socialsdisplay0): mantra_header_socials(); endif;
echo '</div>';
-
+
} // mantra_title_and_description()
@@ -318,6 +318,16 @@ function mantra_pagination($pages = '', $range = 2, $prefix ='')
}
endif;
+function mantra_nextpage_links($defaults) {
+$args = array(
+'link_before' => '<em>',
+'link_after' => '</em>',
+);
+$r = wp_parse_args($args, $defaults);
+return $r;
+}
+add_filter('wp_link_pages_args','mantra_nextpage_links');
+
/**
* Site info
@@ -357,42 +367,60 @@ add_action('wp_ajax_nopriv_do_ajax', 'mantra_ajax_function');
add_action('wp_ajax_do_ajax', 'mantra_ajax_function');
-/**
-* Retrieves the IDs for images in a gallery.
+/**
+* Retrieves the IDs for images in a gallery.
* @since mantra 2.1.1
-* @return array List of image IDs from the post gallery.
-*/
-function mantra_get_gallery_images() {
- $images = array();
-
- if ( function_exists( 'get_post_galleries' ) ) {
- $galleries = get_post_galleries( get_the_ID(), false );
- if ( isset( $galleries[0]['ids'] ) )
- $images = explode( ',', $galleries[0]['ids'] );
- } else {
- $pattern = get_shortcode_regex();
- preg_match( "/$pattern/s", get_the_content(), $match );
- $atts = shortcode_parse_atts( $match[3] );
- if ( isset( $atts['ids'] ) )
- $images = explode( ',', $atts['ids'] );
- }
-
- if ( ! $images ) {
- $images = get_posts( array(
- 'fields' => 'ids',
- 'numberposts' => 999,
- 'order' => 'ASC',
- 'orderby' => 'menu_order',
- 'post_mime_type' => 'image',
- 'post_parent' => get_the_ID(),
- 'post_type' => 'attachment',
- ) );
- }
-
- return $images;
+* @return array List of image IDs from the post gallery.
+*/
+function mantra_get_gallery_images() {
+ $images = array();
+
+ if ( function_exists( 'get_post_galleries' ) ) {
+ $galleries = get_post_galleries( get_the_ID(), false );
+ if ( isset( $galleries[0]['ids'] ) )
+ $images = explode( ',', $galleries[0]['ids'] );
+ } else {
+ $pattern = get_shortcode_regex();
+ preg_match( "/$pattern/s", get_the_content(), $match );
+ $atts = shortcode_parse_atts( $match[3] );
+ if ( isset( $atts['ids'] ) )
+ $images = explode( ',', $atts['ids'] );
+ }
+
+ if ( ! $images ) {
+ $images = get_posts( array(
+ 'fields' => 'ids',
+ 'numberposts' => 999,
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order',
+ 'post_mime_type' => 'image',
+ 'post_parent' => get_the_ID(),
+ 'post_type' => 'attachment',
+ ) );
+ }
+
+ return $images;
} // mantra_get_gallery_images()
+/**
+* Checks the browser agent string for mobile ids and adds "mobile" class to body if true
+* @since mantra 2.2.3
+* @return array list of classes.
+*/
+function mantra_mobile_body_class($classes){
+$mantra_options = mantra_get_theme_options();
+ if ($mantra_options['mantra_mobile']=="Enable"):
+ $browser = $_SERVER['HTTP_USER_AGENT'];
+ $keys = 'mobile|android|mobi|tablet|ipad|opera mini|series 60|s60|blackberry';
+ if (preg_match("/($keys)/i",$browser)): $classes[] = 'mobile'; endif; // mobile browser detected
+ endif;
+ return $classes;
+}
+
+add_filter('body_class', 'mantra_mobile_body_class');
+
+
if ( ! function_exists( 'mantra_ajax_function' ) ) :
function mantra_ajax_function(){
@@ -438,7 +466,7 @@ function mantra_ajax_get_latest_posts($count,$categName){
// Reset Query
wp_reset_query();
-
+
return $testVar;
}
endif;
diff --git a/themes/mantra/includes/theme-loop.php b/themes/mantra/includes/theme-loop.php
index 909858ec..7d09d4c6 100644
--- a/themes/mantra/includes/theme-loop.php
+++ b/themes/mantra/includes/theme-loop.php
@@ -284,7 +284,7 @@ $image_src = cryout_echo_first_image($post->ID);
the_post_thumbnail( 'custom', array("class" => "align".strtolower($mantra_falign)." post_thumbnail" ) );
else if ($mantra_fpost=='Enable' && $mantra_fauto=="Enable" && $image_src && ($mantra_excerptarchive != "Full Post" || $mantra_excerpthome != "Full Post"))
- echo '<a title="'.the_title_attribute('echo=0').'" href="'.get_permalink().'" ><img title="" alt="" class="align'.strtolower($mantra_falign).' post_thumbnail" src="'.$image_src.'"></a>' ;
+ echo '<a title="'.the_title_attribute('echo=0').'" href="'.get_permalink().'" ><img width="'.$mantra_fwidth.'" title="" alt="" class="align'.strtolower($mantra_falign).' post_thumbnail" src="'.$image_src.'"></a>' ;
}
endif; // mantra_set_featured_thumb
diff --git a/themes/mantra/includes/theme-seo.php b/themes/mantra/includes/theme-seo.php
index 11899bbe..6589f40c 100644
--- a/themes/mantra/includes/theme-seo.php
+++ b/themes/mantra/includes/theme-seo.php
@@ -12,18 +12,18 @@ function mantra_filter_wp_title( $title ) {
// Get the Site Name
$site_name = get_bloginfo( 'name' );
// Prepend name
- $filtered_title = $title.' - '.$site_name;
+ $filtered_title = (((strlen($site_name)>0)&&(strlen($title)>0))?$title.' - '.$site_name:$title.$site_name);
// Get the Site Description
$site_description = get_bloginfo( 'description' );
// If site front page, append description
- if ( (is_home() || is_front_page()) && $site_description ) {
+ if ( (is_home() || is_front_page()) && $site_description ) {
// Append Site Description to title
- $filtered_title =$site_name. " | ".$site_description;
+ $filtered_title = ((strlen($site_name)>0)&&(strlen($site_description)>0))?$site_name. " | ".$site_description:$site_name.$site_description;
}
// Add pagination if that's the case
global $page, $paged;
if ( $paged >= 2 || $page >= 2 )
- $filtered_title .= ' | ' . sprintf( __( 'Page %s', 'mantra' ), max( $paged, $page ) );
+ $filtered_title .= ' | ' . sprintf( __( 'Page %s', 'parabola' ), max( $paged, $page ) );
// Return the modified title
return $filtered_title;
diff --git a/themes/mantra/includes/theme-setup.php b/themes/mantra/includes/theme-setup.php
index 3f2ad3da..20841606 100644
--- a/themes/mantra/includes/theme-setup.php
+++ b/themes/mantra/includes/theme-setup.php
@@ -6,13 +6,14 @@
* @subpackage Functions
*/
+/*
// Bringing up Mantra Settings page after install
-
if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
wp_redirect( 'themes.php?page=mantra-page' );
}
+*/
- $mantra_totalSize = $mantra_sidebar + $mantra_sidewidth+50;
+$mantra_totalSize = $mantra_sidebar + $mantra_sidewidth+50;
/**
diff --git a/themes/mantra/includes/theme-shortcodes.php b/themes/mantra/includes/theme-shortcodes.php
index 63b4a543..5c238333 100644
--- a/themes/mantra/includes/theme-shortcodes.php
+++ b/themes/mantra/includes/theme-shortcodes.php
@@ -16,6 +16,16 @@ add_shortcode( 'mantra-button-light', 'mantra_button_light_fn' );
add_shortcode( 'mantra-button-dark', 'mantra_button_dark_fn' );
add_shortcode( 'mantra-button-color', 'mantra_button_color_fn' );
+add_shortcode('cryout-site', 'mantra_site_link_fn');
+add_shortcode('cryout-author', 'mantra_the_author_fn');
+add_shortcode('cryout-tag-cloud', 'mantra_tag_cloud_fn');
+add_shortcode('cryout-multi', 'mantra_multi_column_fn');
+add_shortcode('cryout-column', 'mantra_column_fn');
+add_shortcode( 'cryout-pullquote', 'mantra_pullquote_fn' );
+add_shortcode( 'cryout-button-light', 'mantra_button_light_fn' );
+add_shortcode( 'cryout-button-dark', 'mantra_button_dark_fn' );
+add_shortcode( 'cryout-button-color', 'mantra_button_color_fn' );
+
/**
* Returns a link to the current site
* No attributes
diff --git a/themes/mantra/includes/theme-styles.php b/themes/mantra/includes/theme-styles.php
index 998dd80e..b19e8687 100644
--- a/themes/mantra/includes/theme-styles.php
+++ b/themes/mantra/includes/theme-styles.php
@@ -56,9 +56,10 @@ function mantra_styles_echo() {
foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;}
- echo mantra_custom_styles();
+ echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_custom_styles())."\n";
+ if(($mantra_frontpage=="Enable")&&is_front_page()) { echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_frontpage_css())."\n";}
if($mantra_mobile=="Enable") {wp_enqueue_style( 'mantra-mobile'); echo mantra_mobile_meta();}
- echo mantra_customcss();
+ echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_customcss())."\n";
}
add_action('wp_head', 'mantra_styles_echo');
@@ -66,7 +67,7 @@ add_action('wp_head', 'mantra_styles_echo');
// JS loading and hook into wp_enque_scripts
- add_action('wp_head', 'mantra_customjs' );
+add_action('wp_head', 'mantra_customjs' );
@@ -130,4 +131,4 @@ function mantra_ie_pie() {
}
add_action('wp_head', 'mantra_ie_pie', 10);
-?>
+?> \ No newline at end of file