Jump to content
Sign in to follow this  
signpost

Standard WP not working in Pagelines

Recommended Posts

signpost    0
signpost

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
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
signpost    0
signpost

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • flourishdesignstudio
      By flourishdesignstudio
      I am working on a site that uses post categories to organize a large collection of cocktail recipes (such as 'Fall Cocktails', 'Winter Cocktails', 'Spring Cocktails', and 'Summer Cocktails'). I am trying to style the category pages so that a user will land on the Fall page and see the fall posts in a two-column setup. The Pagelines Content section has no real post display options to speak of so I am trying to work within the Loops section, which does produce the overall visual effect that we are hoping for. However, it means that I have to create a Loops section for every single category page and tell it to show the posts for that specific category (Fall posts on the Fall Category page, Spring posts on the Spring page, etc). We actually have about 25 cocktail categories so creating unique pages for each category isn't going to be very time effective for us - especially if we want to change a setting later and have to go to each page to do that.
      So, my question is whether or not there is a way to control general category pages or if there are any other good post loop options that you recommend. This used to be much easier in the past versions of Pagelines and DMS so I just want to make sure I am not missing something within this new system.
      Thanks so much for the help!
    • huskers2011
      By huskers2011+
      I just upgraded to the platform 5 and all my post lop content in static pages is not visible on the site, although it is  selected in the page setup. 
    • MissT
      By MissT+
      Hi there, the Filter By option within the Masonic section isn't working when a custom post type and custom category is selected.  If you swap to normal posts and categories then it works but sadly not with custom post types and custom categories.
      All posts are shown but when you click on the categories all posts disappear even though posts do have these categories. When you click All all the posts come back. I've tried this on two different websites with the same result.
      Many thanks in advance.
    • B1Guy
      By B1Guy
      I am trying to have my post show up on more than the static page that is defined in >settings>reading.
      I would very much like the post to able to be displayed on 2 other pages "like a second and third recent posts that is displayed like a blog.
      Any help would be great.
      I am somewhat familiar with how coding works but not advanced enough to write the code I think I need for this.
      is there an easier way.
    • bwdsl247
      By bwdsl247
      I am using 'Type' plug-in to create custom post types. 
       
      However, when I go into Flipper (and some other DMS plug-ins) I don't see the custom post types I create in the Post Types drop-down; only Pages, Posts and Testimonials.
       
      I assume Flipper supports custom post types, right?
       
      If so, what settings should I look at to make it so all my custom post types appear in Flipper's drop-down selector for post types.
       
      Thanks!
×