Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Write your awesome functions below H4BS-main*/
- // === 01 === colophon line space to 2 + 8 + 2
- add_filter( 'tc_colophon_left_block_class', 'my_colophon_left_block_class' );
- function my_colophon_left_block_class() {
- return 'span2 social-block pull-left';
- }
- add_filter( 'tc_colophon_center_block_class', 'my_colophon_center_block_class' );
- function my_colophon_center_block_class() {
- return 'span8 credits';
- }
- add_filter( 'tc_colophon_right_block_class', 'my_colophon_right_block_class' );
- function my_colophon_right_block_class() {
- return 'span2 backtop';
- }
- /* === 02 === footer credits*/
- add_filter('tc_credits_display', 'my_custom_credits');
- function my_custom_credits(){
- $newline_credits = '';
- $credits = 'All rights reserved. Customiz´d by<a href="http://www.H4BS.com/" target="_blank"> H4 Business Support</a>';
- return '
- <div class="span8 credits">
- <p> · © '.esc_attr( date( 'Y' ) ).' <a href="'.esc_url( home_url() ).'" title="'.esc_attr(get_bloginfo()).'" rel="bookmark">'.esc_attr(get_bloginfo()).'</a> · '.($credits ? $credits : 'Designed by <a href="http://www.themesandco.com/">Themes & Co</a>').' ·'.($newline_credits ? '<br />· '.$newline_credits.' ·' : '').'</p> </div>';
- }
- /* === 03 === add widget area between footer widgets and colophon */
- add_filter( 'tc_default_widgets' , 'add_footer_colophon_widget' );
- function add_footer_colophon_widget( $defaults ) {
- $defaults['fc_widgets'] = array(
- 'name' => __( 'Footer Colophon Widget' , 'customizr' ),
- 'description' => __( 'Widget Area Before Colophon' , 'customizr' )
- );
- return $defaults;
- }
- add_action('__footer' , 'display_my_fc_widget', 11 );
- function display_my_fc_widget() {
- echo '<div class="footer-colophon">';
- dynamic_sidebar('fc_widgets');
- echo '</div>';
- }
- /* === 04 === title from grid thumbnail to above excerpts*/
- add_action('__post_list_grid', 'my_custom_grid');
- function my_custom_grid(){
- /* title above thumbnails in grid */
- add_filter('tc_post_list_layout', 'title_before', 100);
- function title_before( $layout){
- $layout['show_thumb_first'] = false;
- return $layout;
- }
- }
- /* === 05 === Code to select skin type */
- add_filter('tc_opt_tc_skin', 'my_skin', 20 );
- function my_skin($value){
- global $post;
- if ( isset($post) && $skin=get_post_meta($post->ID, 'skin', 'true')){
- return $skin.'.css';
- }
- return $value;
- }
- /* === 07 === webinar featured page title */
- add_filter('tc_fp_title' , 'my_custom_fp_titles', 10 ,3);
- function my_custom_fp_titles( $original_title , $fp_id = null , $page_id = null ) {
- //assigns a custom title by page id
- $custom_title = array(
- //page id => 'Custom title'
- 1507 => 'Webinars',
- 1675 => 'Webinars pt',
- 1673 => 'Webinars en',
- );
- //if no custom title is defined for the current page id, return original
- if ( ! isset($custom_title[$page_id]) )
- return $original_title;
- return $custom_title[$page_id];
- }
- /* === 08 === facebook box */
- add_action ('wp_head' , 'add_fb_button_script');
- function add_fb_button_script() {
- ?>
- <div id="fb-root"></div>
- <script>(function(d, s, id) {
- var js, fjs = d.getElementsByTagName(s)[0];
- if (d.getElementById(id)) return;
- js = d.createElement(s); js.id = id;
- js.src = "//connect.facebook.net/nl_NL/sdk.js#xfbml=1&version=v2.4&appId=832965396796995";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));</script>
- <?php
- }
- /* === 09 === marketpress */
- add_action('template_redirect', 'handle_marketpress_contents', 100);
- function handle_marketpress_contents(){
- //do nothing if isn't mp shop page
- if ( ! ( function_exists('mp_is_shop_page') && mp_is_shop_page() ) )
- return;
- //display the page content if not displayed by customizr itself
- if ( 'page' != tc__f('__post_type') && is_page() ){
- add_filter('__post_type', '__return_page');
- // don't display post and attachment content
- remove_action('__loop', array( TC_post::$instance, 'tc_post_content'));
- remove_action('__loop', array( TC_attachment::$instance, 'tc_attachment_content'));
- }
- add_filter('tc_set_grid_hooks', '__return_false');
- remove_action ( '__before_loop' , array( TC_headings::$instance , 'tc_render_headings_view' ) );
- function __return_page(){
- return 'page';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement