wildmercury

NZ functions.php

Dec 3rd, 2015
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.94 KB | None | 0 0
  1. <?php
  2. /*  ----------------------------------------------------------------------------
  3.     Newspaper 6 Child theme - Please do not use this child theme with older versions of Newspaper Theme
  4.  
  5.     What can be overwritten via the child theme:
  6.      - everything from /parts folder
  7.      - all the loops (loop.php loop-single-1.php) etc
  8.  
  9.      - the rest of the theme has to be modified via the theme api:
  10.        http://forum.tagdiv.com/the-theme-api/
  11.  
  12.  */
  13.  
  14.  
  15.  
  16.  
  17. /*  ----------------------------------------------------------------------------
  18.     hook used to modify/add/delete items via the theme API
  19.  */
  20. add_action('td_global_after', 'child_theme_td_global_after');
  21. function child_theme_td_global_after() {
  22.     /*
  23.         You can use the api inside this function:
  24.  
  25.         See how the api is used in Newspaper/includes/td_config.php    the API starts from "static function td_global_after() {"
  26.         Api Documentation: http://forum.tagdiv.com/the-child-theme-method/
  27.     */
  28.  
  29. td_api_block::update('td_block_authors',
  30.             array(
  31.                 'map_in_visual_composer' => true,
  32.                 "name" => 'Authors box',
  33.                 "base" => "td_block_authors",
  34.                 "class" => "",
  35.                 "controls" => "full",
  36.                 "category" => 'Blocks',
  37.                 'icon' => 'icon-pagebuilder-td_block_authors',
  38.                 'file' => get_stylesheet_directory() . '/includes/shortcodes/td_block_authors.php',
  39.                 "params" => array(
  40.                     array(
  41.                         "param_name" => "custom_title",
  42.                         "type" => "textfield",
  43.                         "value" => 'OUR AUTHORS',
  44.                         "heading" => "Block title",
  45.                         "description" => "",
  46.                         "holder" => "div",
  47.                         "class" => ""
  48.                     ),
  49.                     array(
  50.                         "param_name" => "custom_url",
  51.                         "type" => "textfield",
  52.                         "value" => "",
  53.                         "heading" => 'Block title - custom url',
  54.                         "description" => "Optional - (when the module title is clicked)",
  55.                         "holder" => "div",
  56.                         "class" => ""
  57.                     ),
  58.                     array(
  59.                         "param_name" => "sort",
  60.                         "type" => "dropdown",
  61.                         "value" => array('- Sort by name -' => '', 'Sort by post count' => 'post_count'),
  62.                         "heading" => 'Sort authors by:',
  63.                         "description" => "",
  64.                         "holder" => "div",
  65.                         "class" => ""
  66.                     ),
  67.                     array(
  68.                         "param_name" => "exclude",
  69.                         "type" => "textfield",
  70.                         "value" => '',
  71.                         "heading" => "Exclude authors id (, separated)",
  72.                         "description" => "",
  73.                         "holder" => "div",
  74.                         "class" => ""
  75.                     ),
  76.                     array(
  77.                         "param_name" => "include",
  78.                         "type" => "textfield",
  79.                         "value" => '',
  80.                         "heading" => "Include authors id (, separated) - do not use with exclude",
  81.                         "description" => "",
  82.                         "holder" => "div",
  83.                         "class" => ""
  84.                     ),
  85.                     array(
  86.                         "type" => "colorpicker",
  87.                         "holder" => "div",
  88.                         "class" => "",
  89.                         "heading" => 'Title text color',
  90.                         "param_name" => "header_text_color",
  91.                         "value" => '', //Default Red color
  92.                         "description" => 'Optional - Choose a custom title text color for this block'
  93.                     ),
  94.                     array(
  95.                         "type" => "colorpicker",
  96.                         "holder" => "div",
  97.                         "class" => "",
  98.                         "heading" => 'Title background color',
  99.                         "param_name" => "header_color",
  100.                         "value" => '', //Default Red color
  101.                         "description" => 'Optional - Choose a custom title background color for this block'
  102.                     )
  103.                 )
  104.             )
  105.         );
  106.  
  107.  
  108. }
  109.  
  110.  
  111.  
  112.  
  113. /*  ----------------------------------------------------------------------------
  114.     add the parent style + style.css from this folder
  115.  */
  116. add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1000 );
  117. function theme_enqueue_styles() {
  118.     wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', '6c', 'all' );
  119.     wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'));
  120.  
  121. }
Advertisement
Add Comment
Please, Sign In to add comment