WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] JetPack Infinite Scroll feature appending /page/x/ to URL ? (16 posts)

  1. flikteoh
    Member
    Posted 1 year ago #

    Infinite Scroll appending /page/# into page URL when scrolling the page back to the top.

    Is this an intended feature or it only happens on my theme?

    I could not find an answer to this anywhere on google searches and noticed that http://ma.tt blog doesn't have the URL appended with page number.

    The blog I need help with is flikteoh.com.

    note: the jetpack support form on jetpack.me has appear to post my support request to http://en.forums.wordpress.com/topic/jetpack-infinite-scroll-feature-appending-pagex-to-url?replies=1

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    You can change this behaviour by going to Settings > Reading in your dashboard, and unchecking the Google Analytics IS tracking option:
    http://i.wpne.ws/MjHh

  3. flikteoh
    Member
    Posted 1 year ago #

    Hi,

    Thanks for your respond.

    The Google Analytics IS tracking option is already off all the while.

    When scrolling up and down on the page, the URL gets appended with /page/2/ and so on.

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Could you try setting wrapper to false, in your function adding Infinite Scroll support?

    The wrapper is used to determine which set of posts is in view, and thus update the URL. If you don't use that wrapper, you can set the option to false, and the URL won't be updated when you scroll down the page.

  5. flikteoh
    Member
    Posted 1 year ago #

    Thanks Jeremy! Setting 'wrapper' to false has fixed the problem!

  6. thinkingman
    Member
    Posted 1 year ago #

    Still happening for me - setting wrapper to false still leaves it appending /page/x to the blog.

  7. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    @thinkingman Could you post a link to your site, so I can have a look?

  8. thinkingman
    Member
    Posted 1 year ago #

    Sure, this site is here. Pay no attention to the rest of the site, it is heavily under construction!

  9. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Thank you. I had a look at your site settings, and the wrapper seems to be set to true at the moment. You can check it by viewing the site's source code, and looking for infiniteScroll:
    http://i.wpne.ws/MpSb

    If you use a cache plugin, you might want to clear the cache or deactivate the plugin to make sure that your changes are applied to your site.

  10. thinkingman
    Member
    Posted 1 year ago #

    That doesn’t make any sense! I do see that the parameter in JavaScript is set to true, however in my code it is set to false. Here is my code:

    function kupuae5_infinite_scroll_init() {
    	add_theme_support( 'infinite-scroll', array(
    		'type'				=>	'scroll',
    		'container'      => 'content',
    		'footer_widgets' => false,
    		'footer'         => false,
    		'wrapper'		 => false,
    		'render'		=>	false,
    	) );
    }
    add_action( 'init', 'kupuae5_infinite_scroll_init' );

    ...notice that my setting for footer is also being ignored...

  11. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Could you check for other instances of add_theme_support( 'infinite-scroll' ) in your theme, just to avoid any duplicate?

  12. thinkingman
    Member
    Posted 1 year ago #

    no - no duplicates.

  13. thinkingman
    Member
    Posted 1 year ago #

    I even added:

    add_filter( 'infinite_scroll_js_settings','kupuae5_enforce_infinite_scroll_init');
    
    function kupuae5_enforce_infinite_scroll_init($args) {
    	$args['footer'] = false;
    	$args['wrapper'] = false;
    	return $args;
    }

    ...and the JavaScript output looks like:

    var infiniteScroll = {"settings":{"id":"content","ajaxurl":"http:\/\/thinkingman.dynalias.com\/news\/?infinity=scrolling","type":"scroll","wrapper":false,"wrapper_class":"infinite-wrap","footer":false,"text":"Load more posts","totop":"Scroll back to top","order":"DESC","scripts":[],"styles":[],"google_analytics":false,"offset":0,"history":{"host":"thinkingman.dynalias.com","path":"\/news\/page\/%d\/","use_trailing_slashes":true},"stats":"blog=42360431&host=thinkingman.dynalias.com&v=ext&j=1:2.1.2&x_pagetype=infinite-jetpack"}};

    ...and in the generated source, you will still find the wrapper!!! :-(

    ...<div class="infinite-wrap infinite-view-1" id="infinite-view-1" data-page-num="1">
    	<article id="post-1358" class="post-1358 post type-post status-publish format-standard hentry category-videos">
    		<header class="entry-header">...
  14. thinkingman
    Member
    Posted 1 year ago #

    Ah! @Jeremy Herve - you were right - it IS a duplicate declaration - but because my theme is a child theme of 2011, JetPack already has a function built-in that adds infinite-scroll support. You have to remove_action before defining your own. Not sure why I overlooked this, maybe it's missing from the online documentation? Before your own add_action, if your theme is derived from one which JetPack has built-in support for, you have to insert the equivalent of this:

    remove_action( 'init', 'twenty_eleven_infinite_scroll_init' );

    ...in order to use infinite-scroll properly! Just FYI for those who are still scratching their heads over this problem...

  15. sabeerali2009
    Member
    Posted 4 months ago #

    Hi Jeremy Herve,

    first i would like to thank you for giving me such a wonderful plugin like this.
    I am using themeforest medium theme. in which theme contain option for enabling infinite scroll
    I need to display the page+page number in the url like http://testsite.com/?page/2.
    for that i have used jetpack extension and also activate my theme by using this following code
    add_theme_support( 'infinite-scroll', array(
    'type' => 'scroll',
    'container' => 'content',
    'footer_widgets' => false,
    'footer' => false,
    'wrapper' => true,
    'posts_per_page' => false,
    'render' => false,
    ) );
    infinite scroll is working fine but my expected url not append like this http://testsite.com/?page/2
    it show only http://testsite.com/
    so could you please guide me how to display the url like this http://testsite.com/?page/2 when scroll down
    kindly reply soon ASAP i am in the dead line of my project
    Thanks in advance

  16. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 4 months ago #

    @sabeerali2009 Could you please start your own thread, as per the Forum Welcome?
    http://wordpress.org/support/plugin/jetpack#postform

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic