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.