Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step 01: Have a 'sections' & 'settings' array like this:
- IN 'sections' array, put this:
- array(
- 'id' => 'homepage_settings',
- 'title' => __( 'Homepage Settings', 'theme-text-domain' )
- )
- IN 'settings' array, put this:
- array(
- 'id' => 'testimonial',
- 'label' => 'Show Testimonial ?',
- 'std' => 'yes',
- 'type' => 'select',
- 'choices' => array(
- array(
- 'label' => 'Yes',
- 'value' => 'yes',
- ),
- array(
- 'label' => 'No',
- 'value' => 'no',
- ),
- ),
- 'section' => 'homepage_settings',
- ),
- Step 02: if your testimonial/Any other sections are not in shortcode, then use get_template_part like this in the homepage:
- <?php get_template_part('testimonial'); ?>
- Step 03: Create testimonial.php OR any sections AND put the content of dynamic testimonial there.
- Step 04: Use the code like this in template-welcome.php OR where needed:
- <?php
- $testimonial = ot_get_option('testimonial');
- ?>
- <?php if($testimonial == 'no'): ?>
- <?php /* My Changes*/ ?>
- <?php else : ?>
- <?php get_template_part('testimonial'); ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement