• Hi, so pagination inst working on a static front page on my theme.
    Looking at pagination and the hungryFEED code as someone who is new to php and web design am I mistaken when I say that it seems that the hungryfeed codes does not use get_query_var(‘page’); and if I wanted to edit to get pagination to work. (only the second page mind you , the first page appears fine), how would I modify it? I tried my luck and ended getting an error so bad WordPress deactivated the plugin o.o.
    When I add hungryfeed to a different page it works fine though, however I need it on the static page one of the center pieces which otherwise works great.

    codeplex:
    Pagination Note: Use get_query_var(‘page’); if you want your query to work in a Page template that you’ve set as your static front page. The query variable ‘page’ also holds the pagenumber for a single paginated Post or Page that includes the <!–nextpage–> Quicktag in the post content.

    HungryFEED:

    $pages = array();
    	$page_num = 0;
    
    	if ($page_size)
    	{
    		// array chunk used for pagination
    		$pages = array_chunk($items, $page_size);
    
    		// grab the requested page from the querystring, make sure it's legit
    		global $wp_query;
    		if (isset($wp_query->query_vars['hf_page']))  $page_num = $wp_query->query_vars['hf_page'];
    		if (is_numeric($page_num) == false || $page_num < 1 || $page_num > count($pages)  ) $page_num = 1;
    	}
    	else
    	{
    		$pages[] = $items;
    		$page_num = 1;
    	}
    
    	$num_pages = count($pages);

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    https://www.ads-software.com/plugins/hungryfeed/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jason

    (@verysimple)

    Hmm there is something bizarre going on, I’m not exactly sure what the deal is. You can get your page to work temporarily by changing these lines in hungryfeed.php

    Line 613 (comment it out)
    //$qvars[] = 'hf_page'; // used by pagination

    Line 261, change to:
    if (isset($_REQUEST['hf_page'])) $page_num = $_REQUEST['hf_page'];

    I’ll have to do some research to see why the queryvars function is causing the static page to mess up with pagination.

    Thank you for that code fix. Worked like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagination’ is closed to new replies.