Forum Replies Created
-
AuthorPosts
-
August 11, 2017 at 4:13 pm in reply to: How to display blog posts from a custom year automatically ? #837499
Hi Günter,
You solved it!
A HUGE thank you!!!You rock!
Have a wonderful weekend!
Anne-Laure
August 11, 2017 at 12:10 pm in reply to: How to display blog posts from a custom year automatically ? #837401This reply has been marked as private.August 10, 2017 at 2:45 pm in reply to: How to display blog posts from a custom year automatically ? #836997Hi Günter,
Thank you for this!
Unfortunately, it’s still showing all of the published posts.
When you define ‘year’ as being 2016, shouldn’t it limit the year to this particular one? In the example you mentioned where year might be 2015 or 2016, how does it knows what to do if I select 2015?
In line 335, I tried to add$atts = shortcode_atts(array('blog_style' => '', 'columns' => 3, 'year' => get_the_date('Y'), 'blog_type' => 'posts', 'items' => '16', 'paginate' => 'yes', 'categories' => '', 'preview_mode' => 'auto', 'image_size' => 'portfolio', 'taxonomy' => 'category', 'post_type'=> get_post_types(), 'contents' => 'excerpt', 'content_length' => 'content', 'offset' => '0', 'conditional' => '' ), $atts, $this->config['shortcode']);
But nothing is working… :-/
Thank you very much again!
Kind regards,
Anne-Laure
August 10, 2017 at 9:39 am in reply to: How to display blog posts from a custom year automatically ? #836853Hi Günter,
Thanks for the explanation!
The issue I have is that I can now select the year. But if I select ‘2016’, I see all published posts. I’m missing something somewhere, but I have no clue what. Do you have any idea?Thank you very much!
Kind regards,
Anne-Laure
August 9, 2017 at 2:33 pm in reply to: How to display blog posts from a custom year automatically ? #836422Hi Günter,
It works fine now. Thanks!
One more thing – if I may – I should define ‘year’ somewhere so the system knows what are ‘2015’ and ‘2016’ (and so it doesn’t considerate those as strings to display).
I would write something like that:
'year' => get_the_date('Y')
But I don’t see where and not sure how to define ‘year’ in the file. Would it be below the following:function query_entries($params) { global $avia_config; $query = array(); if(!empty($params['categories']) && is_string($params['categories'])) { //get the categories $terms = explode(',', $params['categories']); }
?
Thank you very much!
Kind regards,
Anne-Laure
August 8, 2017 at 5:47 pm in reply to: How to display blog posts from a custom year automatically ? #835943Hi Yigit,
Thanks! It helped a lot!
I wrote the code and it is partly working but I guess there is something missing (the first part works fine but it doesn’t display the year below once the option is chosen). Could you tell me where I’m wrong?function popup_elements() { $this->elements = array( array( "name" => __("Do you want to display blog posts?", 'avia_framework' ), "desc" => __("Do you want to display blog posts or entries from a custom taxonomy?", 'avia_framework' ), "id" => "blog_type", "type" => "select", "std" => "posts", "subtype" => array( __('Display blog posts', 'avia_framework') =>'posts', __('Display entries from a custom taxonomy', 'avia_framework') =>'taxonomy', __('Display entries from a custom date', 'avia_framework') => 'year')), array( "name" => __("Which categories should be used for the blog?", 'avia_framework' ), "desc" => __("You can select multiple categories here. The Page will then show posts from only those categories.", 'avia_framework' ), "id" => "categories", "type" => "select", "multiple" => 6, "required" => array('blog_type', 'equals', 'posts'), "subtype" => "cat"), array( "name" => __("Which Entries?", 'avia_framework' ), "desc" => __("Select which entries should be displayed by selecting a taxonomy", 'avia_framework' ), "id" => "link", "fetchTMPL" => true, "type" => "linkpicker", "subtype" => array( __('Display Entries from:', 'avia_framework' )=>'taxonomy'), "multiple" => 6, "required" => array('blog_type', 'equals', 'taxonomy'), "std" => "category" ), array( "name" => __("Which Year?", 'avia_framework' ), "desc" => __("Select which year should be displayed", 'avia_framework' ), "id" => "year", "type" => "select", "multiple" => 6, "required" => array('blog_type', 'equals', 'year'), ),
Thanks a lot!
Cheers,
Anne-Laure
August 8, 2017 at 3:41 pm in reply to: How to display blog posts from a custom year automatically ? #835885Hi Günter,
Thank you for your reply. Once the changes have been done, where should I place the file knowing that I use a child-theme?
Should it be wp-content/theme/child-theme/blog.php,
wp-content/theme/child-theme/avia-shortcodes/blog.php
or child-theme\config-templatebuilder\avia-shortcodes\blog.php ?Thank you!
Best regards,
Anne-Laure
July 25, 2017 at 6:10 pm in reply to: How to display blog posts from a custom year automatically ? #829730Hi John,
Thank you for your reply. Actually, I wanted to make sure the changes had to be done in the blog.php file.
I am a web developer, just not familiar with your theme and the way it works. I have paid for extra support to contact you so could you help me with this?
Thank you!
-
AuthorPosts