- This topic has 7 replies, 3 voices, and was last updated 2 years, 10 months ago by
Tom.
-
AuthorPosts
-
March 20, 2019 at 7:41 pm #845110
Marc
Hi,
I use GP for our department in a college. All our courses were created as pages, and I wanted to allow some level of categorization (by semester (session in French), by competency (Axe de formation in French)), so I installed the “Add Category to Pages” plugin in order to achieve this, rather than converting all pages to posts.
Now, when we click on “Session 1, Session 2, … Session 6”, we get all the courses per semester. Same thing works great with four competencies “Axe de formation « Gestion », Axe de formation « Technologie », etc.)
However, the archive themselves, or list of pages, displayed when we click one of the links, are displayed in ONE column only, rather than two, as I set in Customizer> Layout> Blog> Archive> 2 columns. I can only guess that this setting works only for posts, not for pages, since pages aren’t supposed to have categories? Is there a bit of code I could insert somewhere, in order to have the above archive lists display in two columns, and also to make the first post (page in this case) featured?
Thanks in advance.
March 21, 2019 at 8:19 am #845725Tom
Lead DeveloperLead DeveloperHi there,
Give this a shot:
add_filter( 'generate_blog_columns', function( $columns ) { if ( is_archive() && 'page' === get_post_type() ) { return true; } return $columns; } );
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 6, 2019 at 2:42 pm #950771Harm
I also have the “Add Category to Pages” plugin. In Customizer I designated columns in Layout>Blog>Archives but the post_types “page” at first did’t show up in columns.
With Tom’s function it works like a charm, but…
within the Customizer I always get a blank area. Navigation and headers and such are fine but no content, no columns. On the front-end it all works fine.
What’s wrong with the Customizer display?July 6, 2019 at 6:25 pm #950855Tom
Lead DeveloperLead DeveloperAre there any javascript errors in the Console? You can check by right-clicking the page and choosing “Inspect”.
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 8, 2019 at 3:49 pm #952462Harm
Hi Tom,
Thanks for replying.
GP is great!
Yes, I do get js-errors in Customizer but not able to pin-point where it comes from.
Might be not-GP related…Uncaught Error: Syntax error, unrecognized expression: >h2 class=”widget-title”<>/h2<
at Function.ea.error (jquery.js?ver=1.12.4-wp:2)
at ea.tokenize (jquery.js?ver=1.12.4-wp:2)
at ea.select (jquery.js?ver=1.12.4-wp:2)
at Function.ea (jquery.js?ver=1.12.4-wp:2)
at Function.a.find (jquery-migrate.min.js?ver=1.4.1:2)
at n.fn.init.find (jquery.js?ver=1.12.4-wp:2)
at n.fn.init.a.fn.find (jquery-migrate.min.js?ver=1.4.1:2)
at a.fn.init.n.fn.init (jquery.js?ver=1.12.4-wp:2)
at new a.fn.init (jquery-migrate.min.js?ver=1.4.1:2)
at n (jquery.js?ver=1.12.4-wp:2)Will investigate further tomorrow evening.
July 8, 2019 at 3:57 pm #952465Tom
Lead DeveloperLead DeveloperHmm, strange one. Have you deactivated your other plugins one by one to check if one of them is causing it?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 16, 2020 at 1:58 pm #1287772Marc
It worked! 🙂
May 16, 2020 at 3:13 pm #1287844Tom
Lead DeveloperLead DeveloperAwesome 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.