Guest User

Untitled

a guest
May 26th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. function enigma_child_default_settings()
  2. {
  3. $wl_theme_optionss=array(
  4. 'blog_category'=>'',
  5. );
  6. return apply_filters( 'enigma_child_options', $wl_theme_optionss );
  7. }
  8.  
  9. function enigma_child_get_options() {
  10. // Options API
  11. return wp_parse_args(
  12. get_option( 'enigma_child_options', array() ),
  13. enigma_child_default_settings()
  14. );
  15. }
  16.  
  17. add_action('admin_menu', 'weblizar_admin_portfolio_2');
  18. function weblizar_admin_portfolio_2() {
  19. add_theme_page( 'theme', 'Slider Blog Options', 'edit_theme_options', 'theme', 'weblizar_option_panal_portfolio_2' );
  20. }
  21.  
  22. function weblizar_option_panal_portfolio_2() { ?>
  23. <style type="text/css">
  24. .wrapper.sercive_second {
  25. padding: 20px;
  26. }
  27. .card {
  28. max-width: 100%;
  29. background-color: rgb(0, 133, 186);
  30. color: #fff;
  31. font-weight: bolder;
  32. }
  33. </style>
  34. <?php if(isset($_POST['save']))
  35. {
  36. $wl_theme_optionss['blog_category'] = $_POST['blog_category'];
  37. update_option('enigma_child_options', stripslashes_deep($wl_theme_optionss));
  38. }
  39. ?>
  40. <div class="wrapper sercive_second">
  41. <?php $wl_theme_optionss=get_option('enigma_child_options'); ?>
  42. <div class="block ui-tabs-panel deactive">
  43. <form method="post" id="second_service">
  44. <div class="card card-danger text-center z-depth-2 mb-1">
  45. <h2 style="color: #fff;font-size: 22px;"><?php _e('Slider Blog Settings','weblizar'); ?></h2>
  46. </div>
  47. <div class="section">
  48. <h3><?php _e('Select Blog Category','weblizar'); ?></h3>
  49. <?php $blog_category = $wl_theme_optionss['blog_category']; ?>
  50. <select name="blog_category" class="webriti_inpute" >
  51. <?php $categories = get_categories( array('orderby' => 'name') ); ?>
  52. <option value="default">Select Category</option>
  53. <?php foreach ( $categories as $category ) { ?>
  54. <option value="<?php echo esc_html( $category->slug ); ?>" <?php echo selected($blog_category, $category->slug ); ?>><?php echo esc_html( $category->name ); ?></option>
  55. <?php } ?>
  56. </select>
  57. <span class="explain"><?php _e('Select your Blog category.','weblizar'); ?></span>
  58. </div>
  59.  
  60. <div id="button_section">
  61. <input class="button button-primary" name="save" type="submit" value="Save Options" >
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. <?php
  67. }
Add Comment
Please, Sign In to add comment