Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
mertnuhoglu
tagDiv Member

The pagination issue is caused by offset parameter. I set offset argument to 5 in order not to repeat the posts in the slider. But this causes the “paged” attribute in WP_Query to be ignored. This is documented in WP Codex:

offset (int) – number of post to displace or pass over.
Warning: Setting the offset parameter overrides/ignores the paged parameter and breaks pagination (Click here for a workaround).

Making Custom Queries Using Offset And Pagination
http://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination

I adopted the solution above to my situation as here:

Newspaper-child\functions.php

add_action('pre_get_posts', 'myprefix_query_offset', 1 );
function myprefix_query_offset(&$query) {

    //Before anything else, make sure this is the right query...
    $not_in_ajax_call = get_permalink();
    $in_home_page = ! is_page('');
    if ( $not_in_ajax_call && $in_home_page ) {
        return;
    }
    if ( empty( $query->query['offset'] ) ) {
        return;
    }

    $offset = $query->query['offset'];

    //Next, determine how many posts per page you want (we'll use WordPress's settings)
    $ppp = get_option('posts_per_page');

    //Next, detect and handle pagination...
    if ( $query->is_paged ) {

        //Manually determine page query offset (offset + current page (minus one) x posts per page)
        $page_offset = $offset + ( ($query->query_vars['paged']-1) * $ppp );

        //Apply adjust page offset
        $query->set('offset', $page_offset );
    }
    else {
        //This is the first page. Just use the offset...
        $query->set('offset',$offset);
    }
}
mertnuhoglu
tagDiv Member

Hi Marius,

The problem is caused by offset attribute in WP_Query as described here:

offset (int) – number of post to displace or pass over. Warning: Setting the offset parameter overrides/ignores the paged parameter and breaks pagination (Click here for a workaround).

A workaround is described here.

I try to implement that solution. Any help will be appreciated.

mertnuhoglu
tagDiv Member

I still have the problem. I have just found out the post listings are repating even in infinite scroll mode. See here:

https://forum.tagdiv.com/topic/posts-are-repeated-in-infinite-scroll-feature/

mertnuhoglu
tagDiv Member

I found a solution. Here is it:

Edit Newspaper/includes/app/shortcodes/td_block_3.php:

        $td_query = &$td_data_source->get_wp_query($atts); //by ref  do the query

Add the following line before it:

        $atts['offset'] = 5;
        $td_query = &$td_data_source->get_wp_query($atts); //by ref  do the query

Edit Newspaper/includes/content_builder/td_data_source.php

        extract(shortcode_atts(
                array(
                    'category_ids' => '',
                    'tag_slug' => '',
...             ),
                $atts

Add the following element to the above array:

                    'offset' => 0,

And add the following line after $args created:

$args['offset'] = $offset;

mertnuhoglu
tagDiv Member

An alternative solution is this:

Inside Newspaper/category.php:

$tdc_layout = get_tax_meta($cur_cat_id, ‘tdc_layout’);

Replace with:

$tdc_layout = ‘9’;

mertnuhoglu
tagDiv Member

I set the listing as infinite scroll. So the pages are not visible anymore.

mertnuhoglu
tagDiv Member

Hi, I deactivated all the plugins but the problem still continues. Please check the following two pages. They are exactly the same:

http://test.hayatdefteri.com/page/2/

http://test.hayatdefteri.com/page/3/

mertnuhoglu
tagDiv Member

Hi Marius,

Different pages show the same posts. Look at the following screenshots:

http://dl.dropbox.com/u/103580364/temp/000737.jpg

http://dl.dropbox.com/u/103580364/temp/000738.jpg

2. and 3. pages are exactly the same.

mertnuhoglu
tagDiv Member

Hi,

The Theme Customizer in my theme doesn’t include the option to set Word Length of Module 2:

http://dl.dropbox.com/u/103580364/temp/000729.jpg

mertnuhoglu
tagDiv Member

I need this feature too.

Viewing 11 posts - 1 through 11 (of 11 total)