Forum Replies Created
-
AuthorPosts
-
September 10, 2020 at 1:27 pm in reply to: *Help*: Theme Options no longer displays a sidebar #1244908
Yes it works also for me but also with the same which andyd69 posted.
And need I this plugin now all the time or will be the bug fixed in the near future?
- This reply was modified 4 years, 2 months ago by coolicious.
September 10, 2020 at 9:23 am in reply to: *Help*: Theme Options no longer displays a sidebar #1244799This reply has been marked as private.October 8, 2019 at 3:36 pm in reply to: Change a h3 into div in the comments section – in which file? #1146199Thank you!
Can you maybe tell me too in which file this code is?
October 7, 2019 at 5:33 pm in reply to: Change a h3 into div in the comments section – in which file? #1145855Hey Mike,
no, this one I changed without help. There is another H3 in the code:
<h3 id="reply-title" class="comment-reply-title">Schreibe einen Kommentar <small><a rel="nofollow" id="cancel-comment-reply-link" href="/diy-badekugel-rezepte/rezept-starke-badekugeln-fuer-einen-starken-kreislauf/#respond" style="display:none;">Antworten abbrechen</a></small></h3>
You can find it here (look at the private content):
Hey Victoria,
I dont wanna use a plugin for this :/
Hey Jordan,
I edited the whole post-style therefore I cant go back and switch to “Multi Author”. Do you have other tips for me? :)
Best regards!
September 19, 2019 at 9:35 pm in reply to: Move mobile menu to the bottom of the website and make it fixed? #1140046It works, thank you! :)
August 26, 2019 at 10:09 pm in reply to: How to display parent page title on postslider on homepage? #1131117Hey Ismael,
it works now – I think it was the cache.
Thank you very much for your help!
Best regards!
August 15, 2019 at 8:24 pm in reply to: How to display parent page title on postslider on homepage? #1128042Hey Ismael,
I’m so sry but no this isnt correct. You hard coded it I think and that isnt the right way.
I change the posts there every month because this section displays the three favourite diy recipies of the month which change every month. And the recipies are in different categories not always on the same category. Therfore this category text depends of the first sub category which the recipe was sort in from me when I publish the recipe. You know now what I want there?August 8, 2019 at 10:05 am in reply to: How to display parent page title on postslider on homepage? #1125855Hey Ismael,
thanks for your help.
Could you explain me how this works now? It shows only the sub category “Einfache Rezepte” althouth the posts are not in this sub category.
What should I do?
August 7, 2019 at 12:20 pm in reply to: How to display parent page title on postslider on homepage? #1125480Look at the private content :)
August 6, 2019 at 9:02 am in reply to: How to display parent page title on postslider on homepage? #1125011Thank you Ismael – but this doesnt work – there shows nothing except the icon :/ (Look at the private content)
I have the following code now:
$term_id = get_the_terms( get_the_ID(), 'category' ); $term_children = get_term_children( $term_id[0]->term_id, 'category' ); $output .= "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div><div class='fav-cats'><span class='cal-icon avia_button_icon avia_button_icon_left aria-hidden='true' data-av_icon='' data-av_iconfont='entypo-fontello'></span> ".$term_children[0]->name."</div>";
August 6, 2019 at 1:13 am in reply to: TypeError shows up on develop console – what should I do? #1124925I have version 4.5.7 – why?
- This reply was modified 5 years, 3 months ago by coolicious.
August 5, 2019 at 8:53 pm in reply to: TypeError shows up on develop console – what should I do? #1124886Hey Victoria,
what do you mean with fresh copy?
Best regards
SandroAugust 5, 2019 at 8:52 pm in reply to: How to display parent page title on postslider on homepage? #1124883Thank you for your idea!
I used it in this way, right? But it doesnt show anything now:
$cats = get_term_children( get_the_ID(), 'category' ); $output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div><div class='fav-cats'><span class='cal-icon avia_button_icon avia_button_icon_left aria-hidden='true' data-av_icon='' data-av_iconfont='entypo-fontello'></span> ".$cats[0]->name."</div>" : "";
August 1, 2019 at 9:51 pm in reply to: TypeError shows up on develop console – what should I do? #1123988I needed a class in my submenu and used this code in my child theme functions.php:
/* Add Class to Submenu */ function wp_change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
Therefore I need the avia.js. Do you know an other way to do this?
August 1, 2019 at 1:27 pm in reply to: How to display parent page title on postslider on homepage? #1123893Hi,
thank you for your code.
Right now it displays the parent category. How can I do that if I want to display only the first subcategory?
Thanks!
July 30, 2019 at 5:18 pm in reply to: How to display parent page title on postslider on homepage? #1123195No, that doenst work Ismael but I changed the way to display this posts. Now they are no more pages now they are posts.
Therefore I need a snippet to display just only the first subcategory of every post.Do you can help me with that maybe?
July 29, 2019 at 9:56 pm in reply to: How to display parent page title on postslider on homepage? #1122957Hey,
when I put this code instead of mine, then I get this error message (look at private content)!
Old Code:
$output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div><div class='fav-cats'><span class='cal-icon avia_button_icon avia_button_icon_left aria-hidden='true' data-av_icon='' data-av_iconfont='entypo-fontello'></span> ".apply_filters( 'the_title', get_the_title( wp_get_post_parent_id( get_the_ID() ) ) )."</div>" : "";
New Code:
$output .= "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div><div>".get_the_title( wp_get_post_parent_id( get_the_ID() ) )."</div>" : "";
Right so?
Yes, you can close it :)
I only need help with this right now but this is another question:Thank you! :)
Now it works
Hey Mike,
thank you!
My fault to hide the date omg :D
Yeah I want to replace the “read more” with the date but the code for the functions.php doesnt work.
How can I fix the jquery conflict?
See private content :)
Can nobody help me?
July 26, 2019 at 4:15 pm in reply to: How to display parent page title on postslider on homepage? #1122183Hi,
my pages and posts use the same categories and tags – this is possible with the following code snippet which I included in the functions.php:
/* Kategorien & Tags to Pages */ function add_categories_to_pages() { register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'add_categories_to_pages' ); // add tag support to pages function tags_support_all() { register_taxonomy_for_object_type('post_tag', 'page'); } // ensure all tags are included in queries function tags_support_query($wp_query) { if ($wp_query->get('tag')) $wp_query->set('post_type', 'any'); }
Do you now understand my question and can help me with my problem?
July 24, 2019 at 1:34 pm in reply to: How to display parent page title on postslider on homepage? #1121533Hello Ismael,
I added the code in the postslider.php in row 718:
$output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div><div>".apply_filters( 'the_title', get_the_title( wp_get_post_parent_id( get_the_ID() ) ) )."</div>" : "";
Like I described I want to display the titles of PARENT page (look at the screenshot for example “Einfache Rezepte” within the “post slider” modul from enfold on my homepage (Link in private content). Please look there at the first section of the homepage and you can see that only the title of the PARENT page of the last CHILD page displays on every post although they others CHILD pages have other PARENTs.
Is this more clear? :/
Hey guys,
in which position should I implement the piece of code to display the date?
blog.php
<?php /** * Blog Posts * * Displays Posts from your Blog */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly if ( ! class_exists( 'avia_sc_blog' ) ) { class avia_sc_blog extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['self_closing'] = 'yes'; $this->config['name'] = __('Blog Posts', 'avia_framework' ); $this->config['tab'] = __('Content Elements', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-blog.png"; $this->config['order'] = 40; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_blog'; $this->config['tooltip'] = __('Displays Posts from your Blog', 'avia_framework' ); $this->config['preview'] = false; $this->config['disabling_allowed'] = "manually"; $this->config['disabled'] = array( 'condition' => ( avia_get_option( 'disable_blog' ) == 'disable_blog' ), 'text' => __( 'This element is disabled in your theme options. You can enable it in Enfold » Performance', 'avia_framework' ) ); } function extra_assets() { //load css wp_enqueue_style( 'avia-module-blog' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/blog/blog.css' , array('avia-layout'), false ); wp_enqueue_style( 'avia-module-postslider' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/postslider/postslider.css' , array('avia-layout'), false ); } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "type" => "tab_container", 'nodescription' => true ), array( "type" => "tab", "name" => __("Content" , 'avia_framework'), 'nodescription' => true ), 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') ), 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( 'type' => 'template', 'template_id' => 'date_query', ), array( "name" => __("Blog Style", 'avia_framework' ), "desc" => __("Choose the default blog layout here.", 'avia_framework' ), "id" => "blog_style", "type" => "select", "std" => "single-big", "no_first"=>true, "subtype" => array( __('Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)', 'avia_framework') =>'multi-big', __('Single Author, small preview Pic (no author picture is displayed, feature image is small)', 'avia_framework') =>'single-small', __('Single Author, big preview Pic (no author picture is displayed, feature image is big)', 'avia_framework') =>'single-big', __('Grid Layout', 'avia_framework') =>'blog-grid', __('List Layout - Simple (Title and meta information only)', 'avia_framework' ) =>'bloglist-simple', __('List Layout - Compact (Title and icon only)', 'avia_framework' ) =>'bloglist-compact', __('List Layout - Excerpt (Title, meta information and excerpt only)', 'avia_framework' ) =>'bloglist-excerpt', /* 'no sidebar'=>'fullsize' */ )), array( "name" => __("Blog List Width", 'avia_framework' ), "desc" => __("Define the width of the list", 'avia_framework' ), "id" => "bloglist_width", "type" => "select", "std" => "", "required" => array('blog_style', 'contains', 'bloglist'), "subtype" => array( __('Auto', 'avia_framework' ) =>'', __('Force Fullwidth', 'avia_framework' ) =>'force_fullwidth' )), array( "name" => __("Blog Grid Columns", 'avia_framework' ), "desc" => __("How many columns do you want to display?", 'avia_framework' ), "id" => "columns", "type" => "select", "std" => "3", "required" => array('blog_style', 'equals', 'blog-grid'), "subtype" => AviaHtmlHelper::number_array(1,5,1)), array( "name" => __("Define Blog Grid layout", 'avia_framework' ), "desc" => __("Do you want to display a read more link?", 'avia_framework' ), "id" => "contents", "type" => "select", "std" => "excerpt", "required" => array('blog_style', 'equals', 'blog-grid'), "subtype" => array( __('Title and Excerpt', 'avia_framework' ) =>'excerpt', __('Title and Excerpt + Read More Link', 'avia_framework' ) =>'excerpt_read_more', __('Only Title', 'avia_framework' ) =>'title', __('Only Title + Read More Link', 'avia_framework' ) =>'title_read_more', __('Only excerpt', 'avia_framework' ) =>'only_excerpt', __('Only excerpt + Read More Link', 'avia_framework' ) =>'only_excerpt_read_more', __('No Title and no excerpt', 'avia_framework' ) =>'no') ), array( "name" => __("Blog Content length", 'avia_framework' ), "desc" => __("Should the full entry be displayed or just a small excerpt?", 'avia_framework' ), "id" => "content_length", "type" => "select", "std" => "content", "required" => array('blog_style', 'doesnt_contain', 'blog'), "subtype" => array( __('Full Content', 'avia_framework' ) =>'content', __('Excerpt', 'avia_framework' ) =>'excerpt', __('Excerpt With Read More Link', 'avia_framework' ) =>'excerpt_read_more')), array( "name" => __("Preview Image Size", 'avia_framework' ), "desc" => __("Set the image size of the preview images", 'avia_framework' ), "id" => "preview_mode", "required" => array('blog_style', 'doesnt_contain', 'bloglist'), "type" => "select", "std" => "auto", "subtype" => array(__('Set the preview image size automatically based on column or layout width','avia_framework' ) =>'auto',__('Choose the preview image size manually (select thumbnail size)','avia_framework' ) =>'custom')), array( "name" => __("Select custom preview image size", 'avia_framework' ), "desc" => __("Choose image size for Preview Image", 'avia_framework' ), "id" => "image_size", "type" => "select", "required" => array('preview_mode','equals','custom'), "std" => "portfolio", "subtype" => AviaHelper::get_registered_image_sizes(array('logo')) ), array( "name" => __("Post Number", 'avia_framework' ), "desc" => __("How many items should be displayed per page?", 'avia_framework' ), "id" => "items", "type" => "select", "std" => "3", "subtype" => AviaHtmlHelper::number_array(1,100,1, array('All'=>'-1'))), array( "name" => __("Offset Number", 'avia_framework' ), "desc" => __("The offset determines where the query begins pulling posts. Useful if you want to remove a certain number of posts because you already query them with another blog or magazine element.", 'avia_framework' ), "id" => "offset", "type" => "select", "std" => "0", "subtype" => AviaHtmlHelper::number_array(1,100,1, array(__('Deactivate offset','avia_framework')=>'0', __('Do not allow duplicate posts on the entire page (set offset automatically)', 'avia_framework' ) =>'no_duplicates'))), array( "name" => __("Pagination", 'avia_framework' ), "desc" => __("Should a pagination be displayed? Pagination might not work as expected when there is more than one blog posts element on a page, a post or on the blog page.", 'avia_framework' ), "id" => "paginate", "type" => "select", "std" => "yes", "subtype" => array( __('yes', 'avia_framework' ) =>'yes', __('no', 'avia_framework' ) =>'no')), array( "name" => __("Conditional display", 'avia_framework' ), "desc" => __("When should the element be displayed?", 'avia_framework' ), "id" => "conditional", "type" => "select", "std" => "", "subtype" => array( __('Always display the element', 'avia_framework' ) =>'', __('Remove element if the user navigated away from page 1 to page 2,3,4 etc ', 'avia_framework' ) =>'is_subpage')), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "tab", "name" => __("Screen Options",'avia_framework' ), 'nodescription' => true ), array( "name" => __("Element Visibility",'avia_framework' ), "desc" => __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ), "type" => "heading", "description_class" => "av-builder-note av-neutral", ), array( "desc" => __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'), "id" => "av-desktop-hide", "std" => "", "container_class" => 'av-multi-checkbox', "type" => "checkbox"), array( "desc" => __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'), "id" => "av-medium-hide", "std" => "", "container_class" => 'av-multi-checkbox', "type" => "checkbox"), array( "desc" => __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'), "id" => "av-small-hide", "std" => "", "container_class" => 'av-multi-checkbox', "type" => "checkbox"), array( "desc" => __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'), "id" => "av-mini-hide", "std" => "", "container_class" => 'av-multi-checkbox', "type" => "checkbox"), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "close_div", 'nodescription' => true ), ); if(current_theme_supports('add_avia_builder_post_type_option')) { $element = array( "name" => __("Select Post Type", 'avia_framework' ), "desc" => __("Select which post types should be used. Note that your taxonomy will be ignored if you do not select an assign post type. If yo don't select post type all registered post types will be used", 'avia_framework' ), "id" => "post_type", "type" => "select", "required" => array('blog_type', 'equals', 'taxonomy'), "multiple" => 6, "std" => "", "subtype" => AviaHtmlHelper::get_registered_post_type_array() ); array_splice($this->elements, 4, 0, array($element)); } } /** * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className * * * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_element($params) { $params['innerHtml'] = "<img src='".$this->config['icon']."' title='".$this->config['name']."' />"; $params['innerHtml'].= "<div class='avia-element-label'>".$this->config['name']."</div>"; $params['content'] = NULL; //remove to allow content elements return $params; } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { global $avia_config, $more; $screen_sizes = AviaHelper::av_mobile_sizes($atts); extract($screen_sizes); //return $av_font_classes, $av_title_font_classes and $av_display_classes if(empty($atts['categories'])) $atts['categories'] = ""; if(isset($atts['link']) && isset($atts['blog_type']) && $atts['blog_type'] == 'taxonomy') { $atts['link'] = explode(',', $atts['link'], 2 ); $atts['taxonomy'] = $atts['link'][0]; if(!empty($atts['link'][1])) { $atts['categories'] = $atts['link'][1]; } else if(!empty($atts['taxonomy'])) { $term_args = array( 'taxonomy' => $atts['taxonomy'], 'hide_empty' => true ); /** * To display private posts you need to set 'hide_empty' to false, * otherwise a category with ONLY private posts will not be returned !! * * You also need to add post_status "private" to the query params of filter avia_post_slide_query. * * @since 4.4.2 * @added_by Günter * @param array $term_args * @param array $atts * @param boolean $ajax * @return array */ $term_args = apply_filters( 'avf_av_blog_term_args', $term_args, $atts, $content ); $taxonomy_terms_obj = AviaHelper::get_terms( $term_args ); foreach ($taxonomy_terms_obj as $taxonomy_term) { $atts['categories'] .= $taxonomy_term->term_id . ','; } } } $atts = shortcode_atts( array( 'blog_style' => '', 'bloglist_width' => '', 'columns' => 3, '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' => '', 'date_filter' => '', 'date_filter_start' => '', 'date_filter_end' => '', 'date_filter_format' => 'mm / dd / yy' ), $atts, $this->config['shortcode'] ); $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : get_query_var( 'page' ); if( ! $page ) { $page = 1; } /** * Skip blog queries, if element will not be displayed */ if( $atts['conditional'] == 'is_subpage' && $page != 1 ) { return ''; } if( $atts['blog_style'] == 'blog-grid' ) { $atts['class'] = $meta['el_class']; $atts['type'] = 'grid'; $atts = array_merge($atts, $screen_sizes); /** * @since 4.5.5 * @return array */ $atts = apply_filters( 'avf_post_slider_args', $atts, $this->config['shortcode'], $this ); //using the post slider with inactive js will result in displaying a nice post grid $slider = new avia_post_slider( $atts ); $old_page = null; $is_single = is_single(); if( 'yes' == $atts['paginate'] ) { if( $is_single && isset( $_REQUEST['av_sc_blog_page'] ) && is_numeric( $_REQUEST['av_sc_blog_page'] ) ) { $old_page = get_query_var( 'paged' ); set_query_var( 'paged', $_REQUEST['av_sc_blog_page'] ); } } $slider->query_entries(); if( 'yes' == $atts['paginate'] && $is_single ) { add_filter( 'avf_pagination_link_method', array( $this, 'handler_pagination_link_method'), 10, 3 ); } $html = $slider->html(); if( 'yes' == $atts['paginate'] && $is_single ) { remove_filter( 'avf_pagination_link_method', array( $this, 'handler_pagination_link_method'), 10 ); } if( ! is_null( $old_page ) ) { if( $old_page != 0 ) { set_query_var( 'paged', $old_page ); } else { remove_query_arg( 'paged' ); } } return $html; } $old_page = null; $is_single = is_single(); if( 'yes' == $atts['paginate'] ) { if( $is_single && isset( $_REQUEST['av_sc_blog_page'] ) && is_numeric( $_REQUEST['av_sc_blog_page'] ) ) { $old_page = get_query_var( 'paged' ); set_query_var( 'paged', $_REQUEST['av_sc_blog_page'] ); } } $this->query_entries( $atts ); if( 'yes' == $atts['paginate'] && $is_single ) { add_filter( 'avf_pagination_link_method', array( $this, 'handler_pagination_link_method'), 10, 3 ); } $avia_config['blog_style'] = $atts['blog_style']; $avia_config['preview_mode'] = $atts['preview_mode']; $avia_config['image_size'] = $atts['image_size']; $avia_config['blog_content'] = $atts['content_length']; $avia_config['remove_pagination'] = $atts['paginate'] === "yes" ? false :true; /** * Force supress of pagination if element will be hidden on foillowing pages */ if( $atts['conditional'] == 'is_subpage' && $page == 1 ) { $avia_config['remove_pagination'] = true; } $more = 0; ob_start(); //start buffering the output instead of echoing it get_template_part( 'includes/loop', 'index' ); $output = ob_get_clean(); wp_reset_query(); if( 'yes' == $atts['paginate'] && $is_single ) { remove_filter( 'avf_pagination_link_method', array( $this, 'handler_pagination_link_method'), 10 ); } if( ! is_null( $old_page ) ) { if( $old_page != 0 ) { set_query_var( 'paged', $old_page ); } else { remove_query_arg( 'paged' ); } } avia_set_layout_array(); if($output) { $extraclass = function_exists('avia_blog_class_string') ? avia_blog_class_string() : ""; $extraclass .= $atts['bloglist_width'] == 'force_fullwidth' ? ' av_force_fullwidth' : ""; $markup = avia_markup_helper(array('context' => 'blog','echo'=>false, 'custom_markup'=>$meta['custom_markup'])); $output = "<div class='av-alb-blogposts template-blog {$extraclass} {$av_display_classes}' {$markup}>{$output}</div>"; } return $output; } /** * * @since < 4.0 * @param array $params */ protected function query_entries( array $params ) { global $avia_config; $query = array(); if( ! empty($params['categories']) && is_string($params['categories'] ) ) { //get the categories $terms = explode( ',', $params['categories'] ); } $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : get_query_var( 'page' ); if(!$page || $params['paginate'] == 'no') $page = 1; if($params['offset'] == 'no_duplicates') { $params['offset'] = 0; $no_duplicates = true; } if(empty($params['blog_type']) || $params['blog_type'] == 'posts') $params['post_type'] = 'post'; if(empty($params['post_type'])) $params['post_type'] = get_post_types(); if(is_string($params['post_type'])) $params['post_type'] = explode(',', $params['post_type']); //wordpress 4.4 offset fix if( $params['offset'] == 0 ) { $params['offset'] = false; } else { //if the offset is set the paged param is ignored. therefore we need to factor in the page number $params['offset'] = $params['offset'] + ( ($page -1 ) * $params['items']); } $date_query = array(); if( 'date_filter' == $params['date_filter'] ) { $date_query = AviaHelper::add_date_query( $date_query, $params['date_filter_start'], $params['date_filter_end'], $params['date_filter_format'] ); } //if we find categories perform complex query, otherwise simple one if(isset($terms[0]) && !empty($terms[0]) && !is_null($terms[0]) && $terms[0] != "null" && !empty($params['taxonomy'])) { $query = array( 'paged' => $page, 'posts_per_page' => $params['items'], 'offset' => $params['offset'], 'post__not_in' => ( ! empty( $no_duplicates ) ) ? $avia_config['posts_on_current_page'] : array(), 'post_type' => $params['post_type'], 'date_query' => $date_query, 'tax_query' => array( array( 'taxonomy' => $params['taxonomy'], 'field' => 'id', 'terms' => $terms, 'operator' => 'IN' ) ) ); } else { $query = array( 'paged' => $page, 'posts_per_page' => $params['items'], 'offset' => $params['offset'], 'post__not_in' => ( ! empty( $no_duplicates ) ) ? $avia_config['posts_on_current_page'] : array(), 'post_type' => $params['post_type'], 'date_query' => $date_query ); } /** * * @since < 4.0 * @param array $query * @param array $params * @return array */ $query = apply_filters( 'avia_blog_post_query', $query, $params ); $results = query_posts( $query ); // store the queried post ids in if( have_posts() ) { while( have_posts() ) { the_post(); $avia_config['posts_on_current_page'][] = get_the_ID(); } } } /** * Using this element not in a page ( = is_single() ) returns a wrong pagination * * @since 4.5.6 * @param string $method * @param type $pages * @param type $wrapper * @return string */ public function handler_pagination_link_method( $method, $pages, $wrapper ) { if( is_single() || ( 'get_pagenum_link' == $method ) ) { $method = 'avia_sc_blog::add_blog_pageing'; } return $method; } /** * Called when this element not in a page ( = is_single() ). * Add our custom page parameter. * * @since 4.5.6 * @param int $page * @return string */ static public function add_blog_pageing( $page ) { $link = get_pagenum_link( 1 ); if( $page != 1 ) { $link = add_query_arg( array( 'av_sc_blog_page' => $page ), $link ); } else { $link = remove_query_arg( 'av_sc_blog_page', $link ); } return $link; } } }
Thank you Mike :)
When I want to add the ” publishing date” to the frontend, how can I do that? (look at private content)
Thank you!
Thanks for your reply.
I added some custom CSS yet, thats not my problem.
And I want to know where exactly the file is. Your given location is not enough for me to find it.June 28, 2019 at 8:58 pm in reply to: Put GDPR checkbox & text under submit button not before – how? #1114360Sure:
June 27, 2019 at 4:46 pm in reply to: Put GDPR checkbox & text under submit button not before – how? #1114003Ok, I deactivated WPRocket and the “jump” problem is still there – what can I do?
-
AuthorPosts