Title: Error with the_permalink() using browser-sync with Gulp in localhost
Last modified: October 26, 2016

---

# Error with the_permalink() using browser-sync with Gulp in localhost

 *  Resolved [daniel002](https://wordpress.org/support/users/daniel002/)
 * (@daniel002)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/)
 * Hi, in my workflow I use browser-sync with Gulp, normally the permalinks are 
   like this:
 * [http://localhost:3000/mywebsite/store-item/](http://localhost:3000/mywebsite/store-item/)
 * But when I use the Ajax Load More plugin, the permalinks change to:
 * [http://localhost/mywebsite/store-item/](http://localhost/mywebsite/store-item/)
 * Here my shortcode:
    <?php echo do_shortcode(‘[ajax_load_more repeater=”template_1″
   post_type=”mic_store” posts_per_page=”10″ transition_speed=”500″ scroll=”true”
   transition=”fade” transition_container=”false” button_label=”Ver Más” button_loading_label
   =”Cargando…”]’); ?>
 * It seems that exist a conflict with the plugin and browser-sync.
 * Thanks for any advice!

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8360650)
 * Hi [@daniel002](https://wordpress.org/support/users/daniel002/),
    Not sure these
   Browser Sync issues have anything to do with Ajax Load More.
 * Are you saying `the_permalink()` is stripping `:3000` from the url only when 
   used with repeater templates?
 * Is there any other specific reasons you think the plugin could be causing your
   issues?
 * Cheers,
 *  Thread Starter [daniel002](https://wordpress.org/support/users/daniel002/)
 * (@daniel002)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8360680)
 * Hi,
 * If I replace the shortcode of the plugin with the original code that I wrote 
   the browser-sync reload functionality works totally fine ([http://localhost:3000](http://localhost:3000)
   appears again), so it seems there is a kind of incompatibility.
 * By the way, I am using the Ajax Load More – Repeater Templates paid plugin, I
   put my code in the fields of the plugin admin panel.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8360682)
 * Hi Daniel,
    Can you share your repeater template?
 * Cheers,
 *  Thread Starter [daniel002](https://wordpress.org/support/users/daniel002/)
 * (@daniel002)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8360715)
 * Of course:
 *     ```
       <div class="row flexbox-centrado-y flexbox-responsiveTop768 poemas-contenido">
       	<!-- Izq -->
       	<div class="col-lg-5 col-md-5 col-sm-4 flexbox-centrado-y contenido-nombre">
       		<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
       	</div>
   
       	<!-- Der -->
       	<div class="col-lg-7 col-md-7 col-sm-8 contenido-texto">
       		<ul>
       			<?php
       				$args_poema = array(
       					'post_type'       => 'ubd_ingrediente',
       					'posts_per_page'  => -1,
       					'orderby'         => 'date',
       					'order'           => 'DESC',
       					'meta_query'		  => array(
       						array(
       							'key' => 'autor_poema',
       							'value' => get_the_ID()
       						)
       					)
       				);
   
       				$obj_poema = new WP_Query($args_poema);
       			?>
       			<?php if($obj_poema->have_posts()) : while($obj_poema->have_posts()) : $obj_poema->the_post(); ?>
       			<li>
       				<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
       				<span>
       					<?php get_template_part('modulos/reproductor', 'poemas'); ?>
       					<?php $lector = get_field('nombre_lector'); ?>
       					<?php if(!empty($lector)) { ?>
       					<?php echo get_the_title($lector); ?>
       					<?php } ?>
       				</span>
       			</li>
   
       		<?php endwhile; endif; ?>
       		<?php wp_reset_postdata(); ?>
   
       		</ul>
       	</div>
       </div>
       ```
   
 * And the shortcode:
 * `<?php echo do_shortcode('[ajax_load_more repeater="template_1" post_type="ubd_proyecto"
   posts_per_page="10" transition_speed="500" scroll="true" transition="fade" transition_container
   ="false" button_label="Ver Más" button_loading_label="Cargando..."]'); ?>`
 * Thanks!
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8363343)
 * Hey Daniel,
    Thanks, it looks fine – I’m honestly not sure… I haven’t tested 
   with Browser Sync before. it’s strange that `the_permalink` would be removing
   the `:3000`only in the repeater template.
 * Are both the h3 link and the nested query links incorrect?
 *  Thread Starter [daniel002](https://wordpress.org/support/users/daniel002/)
 * (@daniel002)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8363471)
 * Hi,
    Yes, both links remove the :3000 of the url Besides, all the other permalinks
   where I’m not using the plugin are working fine. Maybe you should test the plugin
   with Gulp + Browser Sync,
 * Thanks for the help!
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-8376278)
 * > Maybe you should test the plugin with Gulp + Browser Sync,
 * I’ll add this to my list if I get some time.
 * Marking as resolved for now, if you end up figure this out i’d appreciate it 
   if you could post back here.
 * Cheers,
 *  [kmeronuk](https://wordpress.org/support/users/kmeronuk/)
 * (@kmeronuk)
 * [9 years ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-9134930)
 * I’m experiencing this same issue. I use DesktopServer to deal with my local development
   installations, and map domains to them.
 * What’s happening here for example is:
    – local install domain set as [http://www.example.dev/](http://www.example.dev/)–
   theme is built off of Sage by roots.io and running with gulp and browsersync 
   set up so that as I make changes, in my browser the site is running from [http://localhost:3000/](http://localhost:3000/)
   and automatically refreshes as changes are made – when running via browsersync
   anywhere I use the_permalink() it replaces localhost:3000/ with [http://www.example.dev/](http://www.example.dev/)
 * Couldn’t figure out why my browser stopped refreshing when I was trying to make
   edits to the alm templates until I finally noticed that when I clicked on links
   that were from the alm templates, it was replacing the URL.
 * Not a huge issue since it only affects local development, but will still be great
   to have it fixed if possible.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Error with the_permalink() using browser-sync with Gulp in localhost’
is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [kmeronuk](https://wordpress.org/support/users/kmeronuk/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/error-with-the_permalink-using-browser-sync-with-gulp-in-localhost/#post-9134930)
 * Status: resolved