Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
How to display a button in header on only one specific page

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>';
}
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Find the id of register page. Suppose it is 1675, write following CSS:

.header-menu-btn {display: none !important}
.page-id-1675 .header-menu-btn {display: inline !important}
about 4 years ago · Juan Pablo Isaza Relatório

0

You can use strpos to check the text is contains or not.

if ( strpos($current_url, 'umacollege.geekss.com.au/register') == true ) {}

If you are using wordpress then best option is to use is_page() function.

if ( is_page( 'register') ) {} // slug

or

if ( is_page( 1675 ) ) {} // page id
about 4 years ago · Juan Pablo Isaza Relatório

0

You can hide the button in the pages you don't want it by aiming the url path with jQuery

jQuery(function ($){
        var pathname = window.location.pathname;
        if (pathname == "/page2/"){
           $(".your_button_class").css("display","none");
          }
    })

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda