Archived

This topic is now archived and is closed to further replies.

  • 0

Standard WP not working in Pagelines


Question

Posted · Report post

I need to add a custom post type to all post queries (blog, tags, category, search, etc).  In wordpress it is achieved by:

add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
  if(is_category() || is_tag()) {
    $post_type = get_query_var('post_type');
    if($post_type)
        $post_type = $post_type;
    else
        $post_type = array('post','gor_map_items');
    $query->set('post_type',$post_type);
    return $query;
    }
}

 

 

For some reason pagelines ignores this change (which is currently working in existing theme), so I implemented a new section like the example above but the pagination does not work.

 

How can I get pagelines not to ignore the above code or use a pagelines hook to fix the problem?  Help needed.

 

Thank you,

 

Simon

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

Hi Simon,

 

PHP isn't really my forte at this moment in time, so I will speak to one of our developers who I'm sure knows the answer. As it is the weekend, the reply may not be until tomorrow, I apologise for any inconvenience this may cause.

Share this post


Link to post
Share on other sites

Posted · Report post

It loads the correct posts for category and tag pages, but on the blog with a static home page it does not load them.  The pagination does not work on any of these pages.

 

Thanks

 

Simon

Share this post


Link to post
Share on other sites