theme-defaults.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * This file adds the Theme Defaults to the Captivating Theme.
  4. *
  5. * @package Captivating
  6. * @subpackage Customizations
  7. * @link http://restored316designs.com/themes
  8. * @author Lauren Gaige // Restored 316 LLC
  9. * @copyright Copyright (c) 2015, Restored 316 LLC, Released 08/09/2017
  10. * @license GPL-2.0+
  11. */
  12. //* Captivating Theme Setting Defaults
  13. add_filter( 'genesis_theme_settings_defaults', 'captivating_theme_defaults' );
  14. function captivating_theme_defaults( $defaults ) {
  15. $defaults['blog_cat_num'] = 5;
  16. $defaults['content_archive'] = 'full';
  17. $defaults['content_archive_limit'] = 500;
  18. $defaults['content_archive_thumbnail'] = 1;
  19. $defaults['image_size'] = 'vertical-entry-image';
  20. $defaults['image_alignment'] = 'alignleft';
  21. $defaults['posts_nav'] = 'numeric';
  22. $defaults['site_layout'] = 'content-sidebar';
  23. return $defaults;
  24. }
  25. //* Captivating Theme Setup
  26. add_action( 'after_switch_theme', 'captivating_theme_setting_defaults' );
  27. function captivating_theme_setting_defaults() {
  28. if( function_exists( 'genesis_update_settings' ) ) {
  29. genesis_update_settings( array(
  30. 'blog_cat_num' => 5,
  31. 'content_archive' => 'full',
  32. 'content_archive_limit' => 500,
  33. 'content_archive_thumbnail' => 1,
  34. 'image_size' => 'vertical-entry-image',
  35. 'image_alignment' => 'alignleft',
  36. 'posts_nav' => 'numeric',
  37. 'site_layout' => 'content-sidebar',
  38. ) );
  39. }
  40. update_option( 'posts_per_page', 5 );
  41. }
  42. //* Captivating Simple Social Icon Defaults
  43. add_filter( 'simple_social_default_styles', 'captivating_social_default_styles' );
  44. function captivating_social_default_styles( $defaults ) {
  45. $args = array(
  46. 'alignment' => 'aligncenter',
  47. 'background_color' => '#FFFFFF',
  48. 'background_color_hover' => '#FFFFFF',
  49. 'border_radius' => 0,
  50. 'border_color' => '#FFFFFF',
  51. 'border_color_hover' => '#FFFFFF',
  52. 'border_width' => 0,
  53. 'icon_color' => '#3a4974',
  54. 'icon_color_hover' => '#333333',
  55. 'size' => 26,
  56. 'new_window' => 1,
  57. );
  58. $args = wp_parse_args( $args, $defaults );
  59. return $args;
  60. }
  61. //* Set Genesis Responsive Slider defaults
  62. add_filter( 'genesis_responsive_slider_settings_defaults', 'captivating_responsive_slider_defaults' );
  63. function captivating_responsive_slider_defaults( $defaults ) {
  64. $args = array(
  65. 'location_horizontal' => 'Left',
  66. 'location_vertical' => 'Top',
  67. 'posts_num' => '5',
  68. 'slideshow_excerpt_content_limit' => '0',
  69. 'slideshow_excerpt_content' => 'full',
  70. 'slideshow_excerpt_width' => '30',
  71. 'slideshow_excerpt_show' => 0,
  72. 'slideshow_height' => '600',
  73. 'slideshow_more_text' => __( 'Read More', 'captivating' ),
  74. 'slideshow_title_show' => 1,
  75. 'slideshow_width' => '1220',
  76. );
  77. $args = wp_parse_args( $args, $defaults );
  78. return $args;
  79. }
  80. //* Set option to show posts on front page after switching themes
  81. add_action( 'after_switch_theme', 'captivating_theme_reading_defaults' );
  82. function captivating_theme_reading_defaults() {
  83. if ( 'posts' != get_option( 'show_on_front' ) ) {
  84. update_option( 'show_on_front', 'posts' );
  85. }
  86. }