Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

68
Views
Cómo eliminar parte de la etiqueta href de los enlaces usando jquery en wordpress

Necesito hacer que todos los enlaces html de mi sitio web de wordpress no terminen en "?amp=1".

Por ejemplo el enlace:

 <a href="https://example.com/page-1/?amp=1">Page 1</a>

Debería cambiar a:

 <a href="https://example.com/page-1/">Page 1</a>

He agregado el siguiente código a mi archivo functions.php pero desafortunadamente no funciona.

 function remove_amptoamp_links(){ ?> <script type="text/javascript"> jQuery(document).ready(function($){ $('a').each(function(){ if(this.href.indexOf("?amp=1") != -1) { var href=this.href.split("?amp=1")[0]; this.href = href; } }); }); </script>'; <?php } add_action('wp_footer', 'remove_amptoamp_links');

¿Un poco de ayuda? ¡Gracias!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Finalmente descubrí que AMP no permite ejecutar Javascript.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!