Support Forums for LiveMesh Themes & Plugins › Forums › Invent Theme Support › Display selected pages in grid
- This topic has 12 replies, 3 voices, and was last updated 8 years, 11 months ago by schercka.
-
AuthorPosts
-
April 24, 2015 at 2:50 pm #13725scherckaMember
Is it possible to order pages displayed with this shortcode?
[show_post_snippets post_type=”page”… ]
Right now it just grabs subpages to one page by using “post_parent=XXX”. But I want to control which subpages are shown, and in which order.
Maybe if it were possible to tag pages with some kind of metadata? I tried changing wordpress standard page order with no effect. And I’m unable to specify page categories or tags to filter on.
April 25, 2015 at 7:07 am #13747VeenaModeratorWith taxonomy and terms specified in post snippets shortcode you will be able to filter specific category from a group of categories.
April 25, 2015 at 12:59 pm #13759scherckaMemberIt’s grabbing the right pages using ‘post_parent’, but I want to change the ORDER of the pages. It’s just spitting them out in seemingly random order. Can I get it to respect default wordpress menu ordering in ASC order? Right now it ignores this order.
April 26, 2015 at 7:28 am #13766scherckaMemberI tried adding:
‘orderby’ => ‘menu_order’,
‘order’ => ‘ASC’to the $args to function mo_show_post_snippets_shortcode in posts-shortcodes.php but with no effect.
April 30, 2015 at 1:15 am #13838RaghavendraModeratorThe shortcode itself does not provide a way to order the items through its attributes. You can order it though by making a code change in the file framework/functions/post-functions.php file at line number 655. You can add the following code –
$query_args['orderby'] = 'menu_order'; $query_args['order'] = 'ASC';
BTW, an upcoming update will have the sorting feature you are requesting and hence the above code change would not be required once the latest version is out this week.
May 4, 2015 at 6:30 pm #13912scherckaMemberHmm that didn’t do anything – seemingly.
I added the code two places, since I wasn’t sure where to put it. See attached.
In WordPress I’ve got this shortcode inserted:
[show_post_snippets post_type=”page” number_of_columns=4 post_parent=13 post_count=”12″ class=”grid-menu” image_size=’medium’ display_title=true display_summary=true excerpt_count=80]And it’s pulling in the pages, but not sorting according to the wordpress page order. I’ve set one of the pages to order 999 just to test, with no result.
Can I use the updated framework/functions/post-functions.php file, or will it not work on its own?
I see in the 1.6 changelog that sorting is only applied to templates, nothing mentioned about post_snippets for pages.May 5, 2015 at 2:43 pm #13927VeenaModeratorKindly take backup of files before making any change.
Pls use updated post-functions.php file and post-shortcodes.php file, and then modify line no: 286 of file post-shortcodes.php as below –
'enable_sorting' => true
And see if it helps otherwise pls let us know.
May 6, 2015 at 5:28 am #13941scherckaMemberThat worked – I had to edit it in the original template though – it didn’t have an effect in the child theme?
Could that be because it requires other files to also be in the child theme folder?
I put it in themes/invent-child/framework and themes/invent-child/functions, but nothing worked until I updated the original files in themes/invent/framework and functions.May 6, 2015 at 11:44 am #13947RaghavendraModeratorShould work with child theme as well. I will need to take a look at the actual changes made by you in the child theme. You may be missing a step actually.
Just wondering why not just update the whole theme to 1.6 since you are using child theme anyway and then you would not need to repeat this in the child theme?
May 7, 2015 at 11:37 am #13978scherckaMemberI updated everything to 1.6 so this is not an issue anymore. However I’m having problems with child theme changes kicking in. Style.css has no problems, but items in my framework folder don’t seem to work, for example in my slug rewrites in custom-post-types.php. Any typical mistakes people make here?
I am using the invent-child included in your zip.
I’ve got the files in the same folder structure /framework/presentation/custom-post-types.php
But changes I make in the invent-child theme don’t have an effect. Only when I make it in the original invent theme? Any ideas?May 7, 2015 at 11:39 am #13979scherckaMemberHere is a screenshot of the structure.
May 7, 2015 at 1:27 pm #13989RaghavendraModeratorIn WordPress you are redefine the template files like single.php, archive.php in the root folder but for any subfolder, you are better off redefining the functions or overriding the classes that you want to customize. You cannot prevent the parent theme from loading the framework classes. In the above case you would include your custom-post-types.php file too in your child theme functions.php (using require_once function call) and then copy the contents of the parent theme file and automatically all the parent theme functions will get overridden due to presence of if (!function_exists(‘function_name’)) checks in the parent theme.
Pls make sure your file is included first before the parent one. It is ok to have same file name as the parent one. Hope this clarifies.
May 7, 2015 at 2:01 pm #13993scherckaMemberI see – thanks for explaining.
I realize this has nothing to do with supporting your theme, so thanks for taking the time. 🙂
-
AuthorPosts
- The topic ‘Display selected pages in grid’ is closed to new replies.