Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //
- // Custom Child Theme Functions
- //
- // More ideas can be found on "A Guide To Customizing The Thematic Theme Framework"
- // http://themeshaper.com/thematic-for-wordpress/guide-customizing-thematic-theme-framework/
- // Google and Facebook Meta Tag
- function google_meta() { ?>
- <meta name="google-site-verification" content="54yhJE3k6tbVv1DkIVTV5XYeO6aZjfGtvUEkAsoqA7E" /><meta property="fb:page_id" content="173421379405020" /><link rel="SHORTCUT ICON" type='image/x-icon' href="http://cookieandkate.com/images/2011/09/favicon1.ico" /><script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-15904891-2']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- <?php }
- add_action ('wp_head','google_meta');
- // Viglink code goes before end body tag
- function viglink_code_beforeendbody() { ?>
- <script type="text/javascript">
- var vglnk = { api_url: '//api.viglink.com/api',
- key: '8bc2f7ad8f77d68e7dfac4e570769aae' };
- (function(d, t) {
- var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;
- s.src = ('https:' == document.location.protocol ? vglnk.api_url :
- '//cdn.viglink.com/api') + '/vglnk.js';
- var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
- }(document, 'script'));
- </script>
- <?php }
- add_action ('thematic_after', 'viglink_code_beforeendbody');
- // Remove the standard Thematic menu
- function remove_menu() {
- remove_action('thematic_header','thematic_access',9);
- }
- add_action('init', 'remove_menu');
- // Moving the thematic menu above the header
- add_action('thematic_aboveheader','thematic_access');
- function childtheme_override_access() { ?>
- <div id="access">
- <div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div><!-- .skip-link -->
- <?php
- if ((function_exists("has_nav_menu")) && (has_nav_menu(apply_filters('thematic_primary_menu_id', 'primary-menu')))) {
- echo wp_nav_menu(thematic_nav_menu_args());
- } else {
- echo thematic_add_menuclass(wp_page_menu(thematic_page_menu_args()));
- }
- ?>
- <div id="access-search">
- <form id="searchform" method="get" action="<?php bloginfo('home') ?>">
- <div>
- <input id="s" name="s" type="text" value="To search, type and hit enter" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" style="width:300px;" tabindex="1" />
- </div>
- </form>
- </div>
- </div><!-- #access -->
- <?php }
- // Filter away the default scripts loaded with Thematic
- function childtheme_head_scripts() {
- // Abscence makes the heart grow fonder
- }
- add_filter('thematic_head_scripts','childtheme_head_scripts');
- function remove_description($display) {
- $display = FALSE;
- return $display;
- }
- add_filter('thematic_show_description', 'remove_description');
- //--- Adding Pin it button below posts
- function webmagic_adding_pinterest($content) {
- if(is_single()):
- $content = $content ."<div id=\"pinterest\"><a href=\"javascript:void((function()
- {var%20e=document.createElement('script');e.setAttribute
- ('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute
- ('src',
- 'http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random
- ()*99999999);document.body.appendChild(e)})());\"><img class=
- \"aligncenter\"
- src=\"http://www.clickinmoms.com/cmprodaily/
- wp-content/uploads/2011/09/pinit.jpg\" alt=\"Pin It\" />
- </div>" ;
- endif;
- return $content;
- }
- add_filter('the_content', 'webmagic_adding_pinterest',99);
- // turn off wordpress RSS links, activate Thematic RSS
- define('THEMATIC_COMPATIBLE_FEEDLINKS', true);
- function feedburner_rss(){
- return '<link rel="alternate" type="application/rss+xml" href="http://feeds.feedburner.com/CookieAndKate" title="Cookie and Kate Posts RSS feed" />';
- }
- add_filter('thematic_rss','feedburner_rss');
- function feedburner_comments_rss(){
- return '<link rel="alternate" type="application/rss+xml" href="http://feeds.feedburner.com/CommentsForCookieAndKate" title="Cookie and Kate Comments RSS feed" />';
- }
- add_filter('thematic_commentsrss','feedburner_comments_rss');
- add_theme_support('post-thumbnails');
- set_post_thumbnail_size(140, 140, true );
- add_image_size( 'popular-thumbnail', 140, 140, true );
- // change post comment text
- function postcomment_text(){
- $text = "Your comments make my day. Thank you!";
- return $text;
- }
- add_filter('thematic_postcomment_text','postcomment_text');
- // following two lines are required for Category Thumbnail List plugin
- set_post_thumbnail_size( form_option('thumbnail_size_w&&echo=false'),
- form_option('thumbnail_size_h&&echo=false'), true );
- function my_post_title($title) {
- if (is_archive() || is_search()) {
- return '<a class="post-thumbnail-link" href="'.get_permalink().'">'.get_the_post_thumbnail(NULL, 'thumbnail').'</a>' . $title;
- } else {
- return $title;
- }
- }
- add_filter('thematic_postheader_posttitle', 'my_post_title');
- function my_post_thumbs() {
- return false;
- }
- add_filter('thematic_post_thumbs','my_post_thumbs');
- function remove_robots($display) {
- $display = FALSE;
- return $display;
- }
- add_filter('thematic_show_robots', 'remove_robots');
- // Puts link in excerpts more tag
- function new_home_excerpts($content){
- if(is_home()) $content='excerpt';
- return $content;
- }
- add_filter('thematic_content','new_home_excerpts');
- // Customizes the read more text
- function new_excerpt_more($more) {
- global $post;
- return '<a href="'. get_permalink($post->ID) . '">Continue to the recipe »</a>';
- }
- add_filter('excerpt_more', 'new_excerpt_more');
- // Define the excerpt length
- function custom_excerpt_length( $length ) {
- return 50;
- }
- add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement