[Resolved] How to Query 2 Child Category Pages on a Parent Category Page?

Home Forums Support [Resolved] How to Query 2 Child Category Pages on a Parent Category Page?

Home Forums Support How to Query 2 Child Category Pages on a Parent Category Page?

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1352130
    Andres

    Hi,

    Could you please help guide me on how to query 2 child category pages on a parent category page?

    I’ve provided the URL on our current site that has this structure in place for reference, if it help. That site uses GP Pro + Elementor. Our site under development is with GP Pro and no page builder.

    There are 3 categories, 1 parent category and 2 child categories. The parent category is “Wedding Venues in Costa Rica”. The 2 Child categories are: 1. Luxury Venues, and 2. Unique Venues.

    The parent category has not posts assigned to it. The child categories have the corresponding posts assigned to them.

    We are looking for a way to query Luxury Venues and Unique Venues on CR Wedding Venues as on the page whose URL is included on the new site (GP Pro with no page builder).

    For all our category pages, we are using custom PHP category page templates along with WP Show Posts Pro. In WPSP, I don’t see an option in Taxonomy to query the two child categories (1. Luxury Venues, and 2. Unique Venues). I was hoping this was possible to then use the short code ID in the PHP template for the parent category (Costa Rica Wedding Venues).

    Thank you very much for your time and enjoy the rest of your weekend.

    Regards,

    Andrés

    #1352368
    David
    Staff
    Customer Support

    Hi there,

    this is really a question for WP Show Posts. However you should see this in the plugin list settings and be able to select multiple terms:

    Likewise you can select the parent category and it will display all child terms as well.

    #1352577
    Andres

    Hi David,

    Thanks for the reply.

    That’s not working. If you look at the URL I sent, on the category page Costa Rica Wedding Venues, there are only 2 items in the list: 1. Luxury Venues, and 2. Unique venues.

    When I do it how you explained, all the posts inside Luxury Venues and Unique Venues appear on the Costa Rica Wedding Venues category page.

    What I’m looking to do is: A visitor goes to the Costa Rica Wedding Venues category page and sees 2 options: 1. Luxury Venues, and 2. Unique. If they want to see luxury venues, they click on Luxury Venues, which takes them to the Luxury Venues category pages on which all the posts on luxury venues appear. If they want to see unique venues, they click on Unique Venues from CR Wedding Venues page and the same happens, but for unique venues.

    I’ll start a support ticket at WPSP.

    Thanks and have a good one!

    Cheers,

    Andrés

    #1352586
    David
    Staff
    Customer Support

    I don’t think you need WP Show Posts. Its job is to display a list of post. It sounds like you need a Link that will take you to each of the archives.

    Let me know.

    #1352996
    Andres

    Hi David,

    Sorry, I really don’t know what is required to make that happen.

    On the current site (GP Pro + Elementor), all three pages are archive pages. Since I did not develop the site, and since I’m not a developer, I am not quite sure how it was done. Luxury Venues and Unique Venues are the child categories, and Wedding Venues in Costa Rica is the parent category.

    What it looks like to me on the category page is that the two options (Luxury Venues and Unique Venues) are in a posts lists given that there is the “Read More” option under each one, which is particular to posts lists.

    This was why I was thinking I would need to use WPSP to do this. If WPSP is not necessary, how would you recommend doing it and be able to maintain the hierarchy so that breadcrumbs can be use?

    On a side note, I was searching for a way to disable the footer on mobile and came across this page: https://generatepress.com/forums/topic/how-to-disable-footer-widgets-only-in-mobile/. I input the CSS provided by Leo, and it does not remove the footer. The CSS you recommend looks like it only disables the footer on a mobile device in which a user is logged in.

    How do I disable the footer in mobile?

    Thank you very much David, and have a good day.

    Sincerely,

    Andrés

    #1353153
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Not too sure I’m fully understanding what’s required here.

    Are you wanting the parent category to output looks to the child categories? What about the posts in that parent category? Where would they display?

    This CSS will hide the footer widgets on mobile: https://generatepress.com/forums/topic/how-to-disable-footer-widgets-only-in-mobile/#post-494633

    Let me know 🙂

    #1353196
    Andres

    Hi Tom,

    That is the same CSS I reference in the previous message. For some reason, it does not disable the footer in mobile.

    This is the CSS I input in Simple CSS, and it did not disable the footer in mobile:

    @media (max-width: 768px) {
        .footer-widgets {
            display: none;
        }
    }

    These are the instruction on GP that I used to create the footer. Maybe I created the footer incorrectly?

    Have a good night

    Cheers!

    Andrés

    #1353425
    David
    Staff
    Customer Support

    Looks like your entire site is built with Elementor, including the site footer. In Elementor you can select a widget and Hide it on mobile within the widgets / section settings.

    For the archive page – you will need to edit the Elementor template linked to the parent archive and change the two links for your sub-category archives.

    There isn’t much we can do as the user who built the site has replaced most of the theme elements with Elementor.

    #1353796
    Andres

    Hi David,

    There are 2 sites, our current site and the site under development. The current site uses GP Pro + Elementor. The site under development uses GP Pro with no page builder. You must have examined the current site.

    We are looking to disable the footer on the site we are developing (GP Pro + no page builder). Here’s a URL for a post on the development site:

    On the development site, I input the CSS below in Simple CSS, and it did not disable the footer in mobile.

    @media (max-width: 768px) {
        .footer-widgets {
            display: none;
        }
    }

    These are the directions I followed to create the footer (sorry, I failed to include the link in the last email): https://docs.generatepress.com/article/footer-bar-widget-area/#adding-a-footer-menu

    Is this the correct way to create a footer? Should the above CSS disable a footer created this way?

    Thanks and have a good day.

    Cheers!

    Andrés

    #1353865
    David
    Staff
    Customer Support

    For the Footer try this to remove the footer bar widgets:

    @media (max-width: 768px) {
        .footer-bar {
            display: none;
        }
    }

    OR this to remove all the footer including copyright:

    @media (max-width: 768px) {
        .site-footer {
            display: none;
        }
    }

    I assume you have a custom category template ? Do you have separate templates for parent and sub-categories ?

    #1354089
    Andres

    Hi David,

    Thanks! That did it!! It removed the footer on all pages, posts, and category pages.

    Did I create the footer using the correct GP instructions correctly? Is there a better way to create the footer that you would recommend?

    Yes, we have custom category templates. We have separate templates for parent and child categories. Why do you ask?

    Thanks and have a good day.

    Sincerly,

    Andrés

    #1354126
    David
    Staff
    Customer Support

    Footer – the way you did it is perfectly fine 🙂

    For your parent Template you could replace the WP Show Posts Loop with some Static HTML to mimic what you had on your elementor site

    #1354229
    Andres

    Hi David,

    Thanks for letting me know the footer was done right. You never know with all the instructions out there that have been published over the years. I always look for the most recent ones.

    Also, thanks for the advice on replicating the Parent Category Template by using static HTML. Unfortunately, I wouldn’t even know where to start to go down that path. Do you have any recommendations?

    What do you think about just creating a page for Costa Rica Wedding Venues (the parent category), use GenerateBlocks to create two columns with the same photos, title, and text, and embed URLs that link to the child categories (Luxury Venues and Unique Venues), and remove the parent category and convert the 2 child categories to regular categories?

    I don’t know what implications this would have for site structure, SEO, and using Yoast breadcrumbs as it’s implemented on the current site (GP + Elementor site). Would this be similar with regards to the above as using static HTML?

    Thanks for your patience and input.

    Cheers!

    Andrés

    #1354500
    Tom
    Lead Developer
    Lead Developer

    That’s what I would do, but I’m not sure what it would do to your breadcrumbs etc..

    Perhaps there’s a way to set a static page as a parent of a category in the breadcrumb settings?

    #1354511
    Andres

    Hi Tom,

    Thanks! I’ll check into it.

    What I might just do is do away with that page al together and have the two options appear in the navigation bar under an item called Wedding Venues. Being able to use keyword phrase “Costa Rica Wedding Venues” was a benefit for SERPs and SEO, but if it’s too much trouble, then …

    I also found a plugin called Easy Query that allows you to “easily” (if you know what you are doing) create custom queries. I’ve messaged the developer to see if it can be used to create a custom query to query those two child categories on the parent category page. If not, that’s life.

    I’ll keep you posted in case something like this every crosses your desk again.

    Have a good evening.

    Andrés

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