SHARE
TWEET

Untitled

a guest Jun 6th, 2018 25 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function wallstreet_blog_customizer( $wp_customize ) {
  3.  
  4. //Index-news Section
  5.     $wp_customize->add_section(
  6.         'news_section_settings',
  7.         array(
  8.             'title' => __('Home blog settings','wallstreet'),
  9.             'priority'       => 750 )
  10.     );
  11.    
  12.    
  13.     // hide meta content
  14.     $wp_customize->add_setting(
  15.     'wallstreet_pro_options[home_meta_section_settings]',
  16.     array(
  17.         'default' => '',
  18.         'capability'     => 'edit_theme_options',
  19.         'sanitize_callback' => '',
  20.         'type' => 'option',
  21.     )  
  22.     );
  23.     $wp_customize->add_control(
  24.     'wallstreet_pro_options[home_meta_section_settings]',
  25.     array(
  26.         'label' => __('Hide blog meta from home page','wallstreet'),
  27.         'section' => 'news_section_settings',
  28.         'type' => 'checkbox',
  29.     )
  30.     );
  31.    
  32.     // add section to manage News
  33.     $wp_customize->add_setting(
  34.     'wallstreet_pro_options[home_blog_heading]',
  35.     array(
  36.         'default' => __('Our latest blog post','wallstreet'),
  37.         'capability'     => 'edit_theme_options',
  38.         'type' => 'option',
  39.         'sanitize_callback' => '',
  40.         )
  41.     ); 
  42.     $wp_customize->add_control( 'wallstreet_pro_options[home_blog_heading]',array(
  43.     'label'   => __('Title','wallstreet'),
  44.     'section' => 'news_section_settings',
  45.      'type' => 'text',)  );
  46.      
  47.      
  48.      $wp_customize->add_setting(
  49.     'wallstreet_pro_options[home_blog_description]',
  50.     array(
  51.         'default' => __('We work with new customers and grow their businesses','wallstreet'),
  52.         'capability'     => 'edit_theme_options',
  53.         'sanitize_callback' => '',
  54.         'type' => 'option',
  55.         )
  56.     ); 
  57.     $wp_customize->add_control('wallstreet_pro_options[home_blog_description]',array(
  58.     'label'   => __('Description','wallstreet'),
  59.     'section' => 'news_section_settings',
  60.      'type' => 'textarea',)  );
  61.  
  62.     //View all posts Button Enable
  63.      $wp_customize->add_setting(
  64.     'wallstreet_pro_options[view_all_posts_btn_enabled]',
  65.     array(
  66.         'default' => true,
  67.         'capability'     => 'edit_theme_options',
  68.         'sanitize_callback' => '',
  69.         'type' => 'option',
  70.         ));
  71.    
  72.     $wp_customize->add_control( 'wallstreet_pro_options[view_all_posts_btn_enabled]',array(
  73.     'label'   => __('Enable view all posts button','wallstreet'),
  74.     'section' => 'news_section_settings',
  75.      'type' => 'checkbox',)  );
  76.      
  77.      
  78.      //View all posts Button text
  79.      $wp_customize->add_setting(
  80.     'wallstreet_pro_options[view_all_posts_text]',
  81.     array(
  82.         'default' => __('View All Posts','wallstreet'),
  83.         'capability'     => 'edit_theme_options',
  84.         'sanitize_callback' => '',
  85.         'type' => 'option',
  86.         )
  87.     ); 
  88.     $wp_customize->add_control( 'wallstreet_pro_options[view_all_posts_text]',array(
  89.     'label'   => __('Button Text','wallstreet'),
  90.     'section' => 'news_section_settings',
  91.      'type' => 'text',)  );
  92.      
  93.      
  94.       //View all posts Button Link
  95.      $wp_customize->add_setting(
  96.     'wallstreet_pro_options[all_posts_link]',
  97.     array(
  98.         'default' =>'#',
  99.         'capability'     => 'edit_theme_options',
  100.         'sanitize_callback' => '',
  101.         'type' => 'option',
  102.         ));
  103.    
  104.     $wp_customize->add_control( 'wallstreet_pro_options[all_posts_link]',array(
  105.     'label'   => __('Button Link','wallstreet'),
  106.     'section' => 'news_section_settings',
  107.      'type' => 'text',)  );
  108.      
  109.      //View all portfolio Button Link
  110.      $wp_customize->add_setting(
  111.     'wallstreet_pro_options[view_all_lnik_target]',
  112.     array(
  113.         'default' => false,
  114.         'capability'     => 'edit_theme_options',
  115.         'sanitize_callback' => '',
  116.         'type' => 'option',
  117.         'description' => 'Open link in a new window/tab',
  118.         ));
  119.    
  120.     $wp_customize->add_control( 'wallstreet_pro_options[view_all_lnik_target]',array(
  121.     'label'   => __('Open link in new tab','wallstreet'),
  122.     'section' => 'news_section_settings',
  123.      'type' => 'checkbox',)  );
  124.    
  125.         }
  126.     add_action( 'customize_register', 'wallstreet_blog_customizer' );
  127.     ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top