Title: Make Related Posts section toggleable
Last modified: August 21, 2016

---

# Make Related Posts section toggleable

 *  [myvancity](https://wordpress.org/support/users/myvancity/)
 * (@myvancity)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/make-related-posts-section-toggleable/)
 * Hello,
    Love the theme btw, site is at myvancity.ca. I would like to put a feature
   request in, simply the ability to toggle the Related Posts section. Currently
   the only related option is just the specification of the name of that section.
   I’d like to be able to fully exclude it so that I can rely on other plugins like
   nRelate.
 * For others who would like this until it’s a feature here’s how I enabled it.
 * Added to line 540 of options.php:
 *     ```
       $options['enable_related'] = array( "name" => __( "Show related posts?", "duena" ),
       	"desc"    => __( "Show or hide related posts.", "duena" ),
       	"id"      => "enable_related",
       	"std"     => "true",
       	"type"    => "radio",
       	"options" => $post_opt_array);
       ```
   
 * Added to line 1300 of options.php:
 *     ```
       /* Related posts */
       $wp_customize->add_setting( 'duena[enable_related]', array(
       	'default' => $options['enable_related']['std'],
       	'type' => 'option'
       ) );
       $wp_customize->add_control( 'duena_enable_related', array(
       	'label' => $options['enable_related']['name'],
       	'section' => 'duena_blog',
       	'settings' => 'duena[enable_related]',
       	'type' => $options['enable_related']['type'],
       	'priority' => 20
       ) );
       ```
   
 * Note: I incremented the priority of the blog_related entry that follows to 21.
 * And finally update the if statement in line 6 to check the enable option:
    `if(
   $tags && ('false' != esc_attr(of_get_option('enable_related')))) {`
 * Hope that’s useful, and would love the option to be available within the theme
   in a future update.
 * All the best,
    Cheers

The topic ‘Make Related Posts section toggleable’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/duena/2.0.0/screenshot.png)
 * Duena
 * [Support Threads](https://wordpress.org/support/theme/duena/)
 * [Active Topics](https://wordpress.org/support/theme/duena/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/duena/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/duena/reviews/)

## Tags

 * [enhancement](https://wordpress.org/support/topic-tag/enhancement/)

 * 0 replies
 * 1 participant
 * Last reply from: [myvancity](https://wordpress.org/support/users/myvancity/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/make-related-posts-section-toggleable/)
 * Status: not resolved