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

155
Visualizações
How to get postid from the body class wordpress

I want to get the postid "36121" from the body tag with JavaScript

Here is the body tag

<body data-rsssl="1" class="post-template-default single single-post postid-36121 single-format-gallery classic-nav no-title sticky-nav" data-pin-hover="true">

Here is my Code

alert($('.post-template-default').attr('class').split('postid-')[1]);

But i get this one "36121 single-format-gallery classic-nav no-title sticky-nav" and i need only this one "36121".

Can someone help me here?

about 4 years ago · Juan Pablo Isaza
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