Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hey noyz319, give me a day or so but I’ll get it up!

    I tried updating my Jetpack, but it looks like I already have the most recent version ( v.2.5? ). Then I use this code to activate infinite scroll on search pages (it also deactivates infinite scroll in WooCommerce).

    function tweakjp_custom_is_support() {
        $supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || isset($_GET['site_section']) || is_search() ) && ( !is_woocommerce() );
    
        return $supported;
    }
    add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );

    The result is that the home page and archives scroll correctly but the search pages still load the homepage posts.

    I want to try this update as well but I don’t want to muck things up by doing it wrong. I already have Jetpack installed, so do I manually upload the individual files or can I install these through the WordPress plugin installer?

    Too late for me to retract my previous post, but part I of my problem is solved: I must have found this same page before because I used the same function name elsewhere to disable search on WooCommerce pages.

    But now there’s a part II to my problem: the posts that infinite scroll loads into search pages are just results from the homepage, they aren’t posts from the search results.

    So if you have any tips about debugging that… I’d much appreciate it! ๐Ÿ™‚

    UPDATE:

    Found this ticket: http://wordpress.org/support/topic/jetpack-infinite-scroll-2?replies=14

    I’ll be following that.

    I want to add IS support for search pages as well. I added the code above but my pages wound up being blank, white and empty. After changing the function name, the pages load, but IS isn’t activating. Got any tips? I’m using a child theme with twentytwelve.

    (I’ve seen your support elsewhere on the forum and I want to thank you for all of it. I’ve gotten a lot of help from your responses elsewhere).

    Here’s the code I plopped into functions.php (including my initialization code).

    function ftchild_twentytwelve_setup() {
    	add_theme_support(
    		'infinite-scroll',
    		array(
    			'posts_per_page' => 1,
    			'container'		 => 'infinite-content',
    			'wrapper'		 => false
    		)
    	);
    }
    add_action( 'after_setup_theme', 'ftchild_twentytwelve_setup', 12 );
    
    // Add infinite scroll support to search pages
    function add_infinite_to_search() {
    	$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() );
    	return $supported;
    }
    add_filter( 'infinite_scroll_archive_supported', 'add_infinite_to_search' );

    I see line 976, and it looks like search might have IS functionality by default. Is that true?

    /**
    977	         * Allow plugins to filter what archives Infinite Scroll supports
    978	         *
    979	         * @uses current_theme_supports, is_home, is_archive, apply_filters, self::get_settings
    980	         * @return bool
    981	         */
    982	        public static function archive_supports_infinity() {
    983	                $supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() );
    984
    985	                return (bool) apply_filters( 'infinite_scroll_archive_supported', $supported, self::get_settings() );
    986	        }

    I’m working on the same problem. Your code, Jeremy, worked by using WooCommerce’s own conditional tags. Here’s how my function wound up:

    // Disable infinite scroll on WooCommerce pages
    function tweakjp_custom_is_support() {
        $supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() ) && ( !is_woocommerce() );
    
        return $supported;
    }
    add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );

    After doing that, I can set the number of items per page by going to WordPress > Reading > “Blog pages show at most.” I can show all items by setting that to “-1”, but if I show less, I don’t get pagination. So I’m trying to get pagination back. Any ideas?

    I eventually created my own infinite scroll function based on this tutorial: http://wp.tutsplus.com/tutorials/theme-development/how-to-create-infinite-scroll-pagination/

    I wanted my function to to display older posts below and newer posts above. I didn’t know how to do that using get_posts or query_posts so I created my own queries.

    If anyone wants my code, I’ll post it. Otherwise I’ll assume the tutorial was enough.

    I found this code really useful:

    http://spruce.it/noise/good-old-2-column-loop-in-wordpres/

    It runs the loop once, but at the beginning of the loop the div is added for one column. Then halfway through the loop, the first div is closed and then the div for the second column is created, which is closed at the end of the loop.

    Write back if you’re still working on this and have questions. I’d be happy to help. ๐Ÿ˜‰

    Cool Ella, glad you found a solution!

    Can you post your results?

    A minute ago I had a link to a similar problem. I think it said something like…

    /tag/dog,cat

    …would produce results that were either in tag dog or cat.

    And…

    /tag/dog+cat

    …would produce results that were tagged BOTH cat and dog.

    So maybe one of these work…

    /tag/dog+cat=dog
    /tag/dog,cat=dog
    /tag/dog&cat=dog

    Post back if you found a solution! ๐Ÿ™‚

    thisismyalterego, did you get Infinite Scroll to work on single.php pages (single posts as opposed to single pages)?

    I’m trying to get Infinite Scroll to work with single posts. Here’s what happens: a single post is loaded. I scroll to the bottom and one extra post is loaded. Then I scroll to the bottom again and no more posts are loaded.

    I have a couple ideas about why this happens:

    1. Only two posts are loaded onto a single.php page, so Infinite Scroll only has one extra post to include. In which case I could try to include more posts into the page’s main query (so far I’ve been unsuccessful).

    2. Infinite Scroll is activated by some mechanism that isn’t reproduced when it displays the second post. For example, Infinite Scroll maybe grabs the URL from the “Next Post” button and retrieves that post to display. If no extra “Next Post” button is created then Infinite Scroll will have no more posts to work with. If this is the case, I’m not sure what to do.

    Does anyone have any advice?

    Right now I’m reading this tutorial to find more clues. http://www.netmagazine.com/tutorials/master-wordpress-loop

    Hi harvitronix,

    I’m currently trying to do the same thing. Have you found a solution yetโ€”either with Jetpack or some other plugin? Below I’ve posted links to threads discussing a similar issue.

    And hi Jeremy! I too would like to know what harvitronix has in mind with his/her infinite scroll on individual posts. In the meantime I wanted to let you know what my team was planning so you can weigh in.

    Although we’re using infinite scroll on the main body of the blog portion of the site, for usability and SEO reasons my team wanted each post to be viewable as an individual post.

    SEO reasons:
    โ€ข We are migrating our site and currently each post is a unique page, so we want to match 1 old URL for 1 new URL.

    Usability reasons:
    โ€ข Ever try to “bookmark” an article that’s only available on a page that scrolls infinitely? It’s terrible! There are some solutions, but they haven’t been adopted on WordPress yet (that I’ve seen). So for the time being we want to maintain unique URLs and unique pages for our visitors to bookmark and share with others. But then when visitors view an individual article, we still want them to easily access our other content. That’s why we’re trying to develop infinite scroll in both directions: scroll up (or click a “Load Newer Posts” button) and you’ll get newer posts loaded on top of the post you cam to see originally. Scroll down or click the “Load Older Posts” button and you’ll be served older posts below the post you came to see.

    The same way we developers believe that infinite scroll on the main blog index will, in general, encourage people to read more content, I hope that this feature on an individual blog post will encourage people who land on an individual blog post to read more content. My team’s trying to optimize our landing pages by including actions that are easily accomplished.

    Catch my drift? Whatcha think about the idea?

    Take care!
    Miguel
    (harvitronix, unless you’d like me to PM you when I find a solution, I’ll post here with my results).

    Here’s a link to a thread where the readers got the “Infinite Scroll” plugin to work with Custom Post Types.

    And here’s another thread that shows how to get the Infinite Scroll plugin to work on Custom Post Pages.

    Contact me if you still need help. I’m not part of the Synved team but the product works for me and I’m sure I can help you with your problem.

    From the sounds of it, you need to add margins or padding (both CSS properties) between your text and images. You can experiment with doing that in all the major browsers by using their developer tools. In Chrome, right click the element you want to affect and choose “Inspect Element” from the context menu. The other browsers have similar wording.

    In Chrome, a big ‘ole box will appear that has your webpage as text and tags. It’s likely that the highlighted text is what you’re looking to change (hover your mouse over any of the ‘elements’ in the Element box and you’ll see which elements onscreen is represented). When you find the element you want to modify, look to the top right for the section called “Styles.” Look for this code:

    element.style {
    // There might be stuff written in here.
    }

    Click inside element.style type “margin” OR “padding,” hit enter, and add some number like 100px and press enter again. The elements on the page should change when you do that. Play around with the margin and padding until you get the spacing you want. If you need more help, search Google for something like “CSS margin” for information about that property.

    Try wrapping your shortcode in this:

    <?php echo do_shortcode( [your_shortcode_here] ) ?>

    Haven’t tried it with this plugin. Let us know whether it works! ๐Ÿ™‚

    Sorry about that. The line I changed looked like this:

    $this->settings = new add_from_server_settings($this);
    // this is what line 137 used to be
    // $this->settings = new add_from_server_settings(&$this);

    It was the ampersand that I deleted.

    I’m not sure why the change worked for me but not for either of you.

    @inversion
    Have you changed your default upload size limit? It begins at 2MB and you can change the limit by modifying php.ini. Using WAMP on Windows 7, my file is found here: wamp > bin > php > php 5.4.3 > php.ini

    And here is what I changed:

    upload_max_filesize from 2M to 64M
    memory_size from 64M to 128M
    post_max_size from 8M to 64M

    To change, for example, the first line, just search the file for “upload_max_filesize” and then change 2M to 64M. I also heard of a method where you create a new php.ini file in your theme folder, but I don’t have instructions atm.

    @slabadie
    Not sure why you got that error. Maybe code in pluggable.php on line 876 relies on the code you’re changing in class.add-from-server.php? If that’s so, then maybe you need to temporarily disable the code that’s relying on class.add-from-server.php.

    Just a thought.

Viewing 15 replies - 1 through 15 (of 17 total)