PHP code example of pixelstudio / wp-custy

1. Go to this page and download the library: Download pixelstudio/wp-custy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pixelstudio / wp-custy example snippets


add_filter( 'custy_sections', function( $sections ) {

  $sections[ 'features' ] = [
    'title' => __( 'Features' ),
    'container' => [ 'priority' => 10 ],
    'options' => [
      
      'has_back_to_top' => [
        'label' => __( 'Has Back to Top?' ),
        'type' => 'ct-switch',
      ],

      'has_fixed_header' => [
        'label' => __( 'Has Fixed Header?' ),
        'type' => 'ct-switch',
      ],

      'has_blog_sidebar' => [
        'label' => __( 'Has Blog Sidebar?' ),
        'type' => 'ct-switch',
      ],
    
    ]
  ];

  return $sections;
} );

add_filter( 'custy_default_values', function( $defaults ) {

  $defaults = wp_parse_args( [
    
    'has_back_to_top' => 'yes',
    'has_fixed_header' => 'no',
    'has_blog_sidebar' => 'yes',

  ], $defaults );

  return $defaults;
} );

if( Custy::get_mod('has_back_to_top') == 'yes' ) {
  // output the back to top markup
}