Category: CodeStar

How to show image from CodeStar Metabox

The non-repeatable image field creation:

[php]
$options[] = array(
‘id’ => ‘_custom_category_options’,
‘post_type’ => ‘category’, // or array( ‘category’, ‘post_tag’ )
‘context’ => ‘normal’,
‘priority’ => ‘default’,
‘sections’ => array(
// begin: a section
array(
‘name’ => ‘section_1’,
‘title’ => ‘Section 1’,
‘icon’ => ‘fa fa-cog’,

// begin: fields
‘fields’ => array(

// a field
array(
‘id’ => ‘sponsors_image’,
‘type’ => ‘image’,
‘title’ => ‘Clients Logo’,
),

), // end: fields
), // end: a section

),
);
[/php]
02. Calling the image on front-end:
[php]

  • How to create image gallery with CodeStar Metabox?

    1.Creating Gallery field:

    // a field
    array(
       'id'          => 'gallery_2',
       'type'        => 'gallery',
       'title'       => 'Logos of the happy clients',
       'add_title'   => 'Add Images',
       'edit_title'  => 'Edit Images',
       'clear_title' => 'Remove Images',
    ),

    Read More “How to create image gallery with CodeStar Metabox?”

  • Implement of Codestar Sorter Field

    Include the code the code in the config file–

    [php]
    // Sorter
    array(
    ‘id’ => ‘aitasi_sorted_section’,
    ‘type’ => ‘sorter’,
    ‘title’ => ‘Section Sorter’,
    ‘default’ => array(
    ‘enabled’ => array(
    ‘home’ => ‘Home’,
    ‘service’ => ‘Service ‘,
    ‘aboutus’ => ‘About Us’,
    ‘contact’ => ‘Contact’,
    ‘footer’ => ‘Footer’,
    ),
    ),
    ‘enabled_title’ => ‘Active Sections’,
    ‘disabled_title’ => ‘Deactive Sections’,
    ),

    [/php]
    Read More “Implement of Codestar Sorter Field”

    CodeStar Typography Field Implementation

    Too enqueue Google fonts ,write the code in your main functions.php –

    [php]
    if ( ! function_exists( ‘cs_wp_enqueue_scripts’ ) ) {
    function cs_wp_enqueue_scripts() {

    $enqueue_fonts = array();
    $google_fonts = array();
    $google_fonts[] = cs_get_option( ‘maintenance_main_typography_one’ );
    $google_fonts[] = cs_get_option( ‘maintenance_main_typography_two’ );

    if ( ! empty( $google_fonts ) ) {
    foreach ( $google_fonts as $font ) {
    if( isset( $font[‘font’] ) && $font[‘font’] == ‘google’ ) {
    $variant = ( isset( $font[‘variant’] ) && $font[‘variant’] !== ‘regular’ ) ? ‘:’. $font[‘variant’] : ”;
    $enqueue_fonts[] = $font[‘family’] . $variant;
    }
    }
    }

    if ( ! empty( $enqueue_fonts ) ) {
    wp_enqueue_style( ‘maintenance-google-fonts’, esc_url( add_query_arg( ‘family’, urlencode( implode( ‘|’,
    $enqueue_fonts ) ) , ‘//fonts.googleapis.com/css’ ) ), array(), ‘1.0’, true );
    }

    }
    add_action( ‘wp_enqueue_scripts’, ‘cs_wp_enqueue_scripts’ );
    }
    [/php]

    Read More “CodeStar Typography Field Implementation”