[Resolved] Change Template on a Page with A Dynamic Slug

Home Forums Support [Resolved] Change Template on a Page with A Dynamic Slug

Home Forums Support Change Template on a Page with A Dynamic Slug

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #417699
    adam

    I’m using a job board plugin, and it generates pages dynamically with a unique slug. These pages (job descriptions) default to automatically reference the template with sidebar right. Any idea how I can target just that slug hierarchy and apply a full width template to all child pages with that slug?

    #417865
    Leo
    Staff
    Customer Support

    Hi there,

    What’s the slug? Just checked the home page you linked and I don’t see anything in the body tag.

    Can you link me to a page with that plugin activated?

    #417885
    adam

    The slug is ‘indeed-jobs’, but that’s being generated from the plugin. I’m not sure why you don’t see any content in the body tag. You looked at the homepage or the link I sent?

    #417894
    adam

    sorry, go to /job-listings

    #417900
    Leo
    Staff
    Customer Support

    Hmm there isn’t indeed-jobs in the body tag that I can see.

    Here are all the body tags in one of the job listing pages: https://s1.postimg.org/72m4uvhv0v/2017-11-07_0857.png

    Maybe try this?

    .ehf-template-generatepress .sidebar {
        display: none;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #417954
    adam

    The .sidebar is displaying as none now.

    #417985
    Leo
    Staff
    Customer Support

    Just to make sure…so it’s working?

    #429255
    adam

    Hi Leo,

    This issue is still unfixed…Here’s a link to the “Job Listings” page.

    http://633.ea8.myftpupload.com/job-listings/

    Once you click on a job, and go to the job description page, instead of passing the content through and using the same template, the dynamically created description page is loading the default template with sidebar. Is it possible to override the default template to the same full width template, instead of the sidebar template?

    BTW, I did remove all plugins and started from scratch with nothing but the indeed plugin and the gp theme. Still having the same issue.

    #429489
    Tom
    Lead Developer
    Lead Developer

    Do you have access to edit this dynamically created page once it’s been created?

    Usually we can use this filter: https://docs.generatepress.com/article/generate_sidebar_layout/

    However, I’m not sure what the conditional would be to make sure we were on pages specific to job listings. Usually instead of creating pages, you would use a custom post type to create a “Job Listings” type, and then we could target the pages inside that post type.

    #429555
    adam

    Actually there were a few things messing with the layout. The “Header Footer Elementor” plugin (I used it for my footer), was injecting some strange padding in there, but more importantly, the sub menu item had a height: 100% which pushed the main content way down. Thinking that came from the GP parent theme though so maybe check that out. I fixed by changing this css:

    .menu-item-has-children .dropdown-menu-toggle {
    	height: inherit;
    }
    	

    Thanks!

    #429786
    Leo
    Staff
    Customer Support

    Glad you figured it out!

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