Hi,
I’d like to add a custom button just beside the search button(I’m using Newspaper Black edition) How can I customize? Currently I’m editing in my child theme the file header-menu-h1.php
this is my code
<div id="td-header-menu" role="navigation">
<div id="td-top-mobile-toggle"><i class="td-icon-font td-icon-mobile"></i></div>
<div class="td-main-menu-logo td-logo-in-menu">
<?php
if (td_util::get_option('tds_logo_menu_upload') == '') {
locate_template('parts/header/logo-h1.php', true, false);
} else {
locate_template('parts/header/logo-mobile-h1.php', true, false);
}?>
</div>
<?php
wp_nav_menu(array(
'theme_location' => 'header-menu',
'menu_class'=> 'sf-menu',
'fallback_cb' => 'td_wp_page_menu',
'walker' => new td_tagdiv_walker_nav_menu()
));
//if no menu
function td_wp_page_menu() {
//this is the default menu
echo '<ul class="sf-menu">';
echo '<li class="menu-item-first">Click here - to select or create a menu';
echo '';
}
?>
</div>
<div class="">
<?php $posts = get_posts('orderby=rand&numberposts=5'); foreach($posts as $post) { ?>
" title="<?php the_title(); ?>"><i class="fa fa-random" aria-hidden="true"></i>
<?php } ?>
</div>
<div class="td-search-wrapper">
<div id="td-top-search">
<!-- Search -->
<div class="header-search-wrap">
<div class="dropdown header-search">
<i class="td-icon-search"></i>
<i class="td-icon-search"></i>
</div>
</div>
</div>
</div>
<div class="header-search-wrap">
<div class="dropdown header-search">
<div class="td-drop-down-search" aria-labelledby="td-header-search-button">
<form method="get" class="td-search-form" action="<?php echo esc_url(home_url( '/' )); ?>">
<div role="search" class="td-head-form-search-wrap">
<input id="td-header-search" type="text" value="<?php echo get_search_query(); ?>" name="s" autocomplete="off" /><input class="wpb_button wpb_btn-inverse btn" type="submit" id="td-header-search-top" value="<?php _etd('Search', TD_THEME_NAME)?>" />
</div>
</form>
<div id="td-aj-search"></div>
</div>
</div>
</div>
Notice the div before td-search-wrapper div class.
I’m trying to add a random article button beside the search button. But my template is broken after I add a class to the div like this: “td-random-article-wrapper” should I register that class first? I can’t seem to find the documentation for templates?
Thanks
Is it also possible if I add PHP scripts here:

Or make a template inline with search or beside the menu

all I want to do is to create a Random Post Button, whenever I click that button, I’ll be redirected to a random post.
Thanks!
Hello rjdtramirez,
After you made the button, from the panel you can set it the certain URL which redirects to another page which has a block sorted by random -> http://screencast.com/t/o5wy5GXk Please notice that any other customization involves custom work and we cannot provide it at the moment, sorry!
Hope this helps!
Thanks for your understanding!