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

286
Views
Elementor muestra el mismo shortcode dos veces (solo en el editor)

Elementor muestra el mismo shortcode dos veces. Uno en el lugar donde se coloca el shortcode, el otro justo detrás del encabezado. El problema solo ocurre en el editor. En la página, se muestra normalmente. Por favor ayuda. ¿Cómo puedo arreglarlo?

 function display_grid_func ( $atts ){ echo '<div class="post-grid">'; $args = array( 'post_type' => 'realizacje', 'post_status' => 'publish', 'posts_per_page' => 9, 'cat' => 5 ); $loop = new WP_Query($args); while ($loop->have_posts()) : $loop->the_post(); ?> <div class="post-tile home"> <a href="<?php the_permalink(); ?>"> <img src="<?php the_post_thumbnail_url('tile-foto'); ?>" /> </a> <a class="button-zobacz home" href="<?php the_permalink(); ?>">Zobacz &#8594;</a> </div> <?php endwhile; wp_reset_postdata();?><?php echo '</div>'; } add_shortcode('post_grid', 'display_grid_func');

Lo que he intentado hasta ahora: -Cambié el tema -Apagué todos los complementos -Estaba buscando en google

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Resolví el problema :) Usé ob_start(); y devuelve ob_get_clean();

 function display_grid_func($atts) { ob_start(); echo '<div class="post-grid">'; $args = array( 'post_type' => 'realizacje', 'post_status' => 'publish', 'posts_per_page' => 9, 'cat' => 5 ); $loop = new WP_Query($args); while ($loop->have_posts()) : $loop->the_post(); ?> <div class="post-tile home"> <a href="<?php the_permalink(); ?>"> <img src="<?php the_post_thumbnail_url('tile-foto'); ?>" /> </a> <a class="button-zobacz home" href="<?php the_permalink(); ?>">Zobacz &#8594;</a> </div> <?php endwhile; wp_reset_postdata(); ?> <?php echo '</div>'; return ob_get_clean(); } add_shortcode('post_grid', 'display_grid_func');
over 4 years ago · Santiago Trujillo 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!