I have added a button of apply now it my header but I just want to display this button on only one page which is register. I do not want this button to appear on other pages of website. When user go to the register page this button should automatically appear in header. So how can I do it?
Below is the code which I used to display the button but this button is displaying on the page not in the header section:
if ( $current_url == 'umacollege.geekss.com.au/register' ) {
echo '<div class="entry-banner">
<div class="container">
<div class="entry-banner-content">
<h1><button type="button">Click Me!</button></h1>
</div></div></div>';
}
3
Answers
Find the id of register page. Suppose it is 1675, write following CSS:
You can use strpos to check the text is contains or not.
If you are using wordpress then best option is to use is_page() function.
or
You can hide the button in the pages you don’t want it by aiming the url path with jQuery