php - changing the menu toggle name for the title of the post in wordpress -
i making first steps learning code. made courses in codeacademy , decided continue learning while build wordpress child theme.
the thing have menu toggle. it's button called menu:
<button id="menu-toggle" class="menu-toggle"><?php _e( 'menu', 'twentysixteen' ); ?></button> what i'm trying replace name "menu" , give name of actual page or post title.
i tried make doesn't work:
<button id="menu-toggle" class="menu-toggle"><?php _e( '<?php the_title(); ?>', 'twentysixteen' ); ?></button> do have suggestion? maybe solution more complex try imagine?
welcome awesome world of php , wordpress development 🙂
the opening php tag ( <?php ) used in button, using again inside __() function result in error...
also, the_title() echo title, not return not pass value __ translation function...
best thing remove __() translation function altogether code looks this...
<button id="menu-toggle" class="menu-toggle"><?php the_title(); ?></button> hope helps...
Comments
Post a Comment