Site logo

[Support request] Query Loop + Custom Post Type = No results found

Home Forums Support [Support request] Query Loop + Custom Post Type = No results found

Home Forums Support Query Loop + Custom Post Type = No results found

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2526378
    Matthew

    I created two custom post types. Identical custom fields. Identical Elements to create the posts (two separate elements). And identical landing pages (two separate landing pages) to display all the custom posts for each. The only difference is the terminology and labeling. For example, one is for ebooks, and the other is for templates.

    For templates build: The landing page and the element that use a query loop (the templates custom post being the data source) both show “No results found” when I click on the query loop block. And I can no longer edit anything within this block.

    For ebooks build: Zero issues. The only difference is the query loop selects its custom post type for the data source.

    Both templates and ebooks output as expected on the front end flawlessly.

    What’s wrong with the templates build? Why “No results found”?

    Any quick recommendations? I have looked over the custom post types and the custom fields carefully. Can’t see any difference between how I created the two.

    Very simple custom post types with few custom fields.

    #2526598
    Fernando
    Customer Support

    Hi Matthew,

    Are both CPTs set to show in the REST API?

    If so, can you provide admin login credentials so we can take a closer look at the issue?

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2527172
    Matthew

    Yes, both CPTs set to show in the REST API.

    #2527514
    David
    Staff
    Customer Support

    Hi there,

    could it be the templates slug ? what if you name it something less generic ( my concern is that something in WP backend may also be using that ) eg. custom-templates

    #2527547
    Matthew

    There were pages using the URLS /ebooks and /templates.

    When I created the CPT slugs (ebooks and templates), I was not blocked from doing so.

    When I tried to create the CPT slug webinars, I was prevented and told to choose a different slug (since /webinars existed as a page). So, I did. And that CPT and GeneratePress work fine.

    So, yeah, maybe, the templates slug should be cm-templates or anything different to prevent the issue.

    It’s just weird that I wasn’t blocked from using CPT slugs ebooks and templates when I created those CPTs given the pages existed. Perhaps those pages (/ebooks and /templates) were drafted at that moment. Not sure.

    #2527572
    Matthew

    Yeah, that seemed to clear it up. Thank you.

    #2528241
    David
    Staff
    Customer Support

    Glad to hear that it is now working 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.