Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author fb-creations

    (@fb-creations)

    Hi, please update the plugin the problem is fixed in the 1.02 version.
    If needed you can delete it before re-install.

    A simple support request would be better for explaining a functional problem with the plugin.

    Hope you enjoy it now and don’t forget to rate better if all works ??

    For me the problem became from my theme, after doing a template archive file by myself, all is ok.

    Forum: Hacks
    In reply to: Probleme with formatting file
    Thread Starter fb-creations

    (@fb-creations)

    Hi i finally found how to use the Loop with several taxonomies : by using query_posts.

    I have to get a string of the searched terms ans pass it to query post args like that :

    ‘my-tax’ => ‘term1, term2’

    With this way, i get no errors, it works like a charm !

    Thank you very much foll all tips.

    Forum: Hacks
    In reply to: Probleme with formatting file
    Thread Starter fb-creations

    (@fb-creations)

    Thank you very much for those explanations !
    I am actually learning JQuery so i think i would be abble to do this in some time…

    Do you mean i should use a template page instead of my shortcode ?

    Ok thank you for your answer i will check what’s going wrong in my code

    Hi, i have almost the same issue, when all filter are setted at “all” only 2 posts are shown on 6. But when i select taxonomies posts are displayed. I don’t understand why some posts are hidden at start because they all the same post-type

    Forum: Hacks
    In reply to: Probleme with formatting file
    Thread Starter fb-creations

    (@fb-creations)

    Thank you very much for help, i did a var dump of backtrace in my code but it don’t seems usefull where i output this :

    array(15) {
      [0]=>
      array(4) {
        ["function"]=>
        string(16) "sc_result_filter"
        ["class"]=>
        string(12) "sc_TaxFilter"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(3) {
          [0]=>
          &array(1) {
            ["posts"]=>
            string(2) "10"
          }
          [1]=>
          &string(0) ""
          [2]=>
          &string(7) "results"
        }
      }
      [1]=>
      array(4) {
        ["file"]=>
        string(56) "C:\xampp\htdocs\wordpress-4.3\wp-includes\shortcodes.php"
        ["line"]=>
        int(308)
        ["function"]=>
        string(14) "call_user_func"
        ["args"]=>
        array(4) {
          [0]=>
          &array(2) {
            [0]=>
            string(12) "sc_TaxFilter"
            [1]=>
            string(16) "sc_result_filter"
          }
          [1]=>
          &array(1) {
            ["posts"]=>
            string(2) "10"
          }
          [2]=>
          &string(0) ""
          [3]=>
          &string(7) "results"
        }
      }
      [2]=>
      array(2) {
        ["function"]=>
        string(16) "do_shortcode_tag"
        ["args"]=>
        array(1) {
          [0]=>
          &array(7) {
            [0]=>
            string(18) "[results posts=10]"
            [1]=>
            string(0) ""
            [2]=>
            string(7) "results"
            [3]=>
            string(9) " posts=10"
            [4]=>
            string(0) ""
            [5]=>
            string(0) ""
            [6]=>
            string(0) ""
          }
        }
      }
      [3]=>
      array(4) {
        ["file"]=>
        string(56) "C:\xampp\htdocs\wordpress-4.3\wp-includes\shortcodes.php"
        ["line"]=>
        int(210)
        ["function"]=>
        string(21) "preg_replace_callback"
        ["args"]=>
        array(3) {
          [0]=>
          &string(186) "/\[(\[?)(embed|wp_caption|caption|gallery|playlist|audio|video|sc_map|results)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/s"
          [1]=>
          &string(16) "do_shortcode_tag"
          [2]=>
          &string(19) "[results posts=10]
    "
        }
      }
      [4]=>
      array(2) {
        ["function"]=>
        string(12) "do_shortcode"
        ["args"]=>
        array(1) {
          [0]=>
          &string(19) "[results posts=10]
    "
        }
      }
      [5]=>
      array(4) {
        ["file"]=>
        string(52) "C:\xampp\htdocs\wordpress-4.3\wp-includes\plugin.php"
        ["line"]=>
        int(213)
        ["function"]=>
        string(20) "call_user_func_array"
        ["args"]=>
        array(2) {
          [0]=>
          &string(12) "do_shortcode"
          [1]=>
          &array(1) {
            [0]=>
            string(19) "[results posts=10]
    "
          }
        }
      }
      [6]=>
      array(4) {
        ["file"]=>
        string(59) "C:\xampp\htdocs\wordpress-4.3\wp-includes\post-template.php"
        ["line"]=>
        int(230)
        ["function"]=>
        string(13) "apply_filters"
        ["args"]=>
        array(2) {
          [0]=>
          &string(11) "the_content"
          [1]=>
          &string(18) "[results posts=10]"
        }
      }
      [7]=>
      array(4) {
        ["file"]=>
        string(78) "C:\xampp\htdocs\wordpress-4.3\wp-content\themes\twentyfifteen\content-page.php"
        ["line"]=>
        int(22)
        ["function"]=>
        string(11) "the_content"
        ["args"]=>
        array(0) {
        }
      }
      [8]=>
      array(4) {
        ["file"]=>
        string(54) "C:\xampp\htdocs\wordpress-4.3\wp-includes\template.php"
        ["line"]=>
        int(557)
        ["args"]=>
        array(1) {
          [0]=>
          string(78) "C:\xampp\htdocs\wordpress-4.3\wp-content\themes\twentyfifteen\content-page.php"
        }
        ["function"]=>
        string(7) "require"
      }
      [9]=>
      array(4) {
        ["file"]=>
        string(54) "C:\xampp\htdocs\wordpress-4.3\wp-includes\template.php"
        ["line"]=>
        int(514)
        ["function"]=>
        string(13) "load_template"
        ["args"]=>
        array(2) {
          [0]=>
          &string(78) "C:\xampp\htdocs\wordpress-4.3/wp-content/themes/twentyfifteen/content-page.php"
          [1]=>
          &bool(false)
        }
      }
      [10]=>
      array(4) {
        ["file"]=>
        string(62) "C:\xampp\htdocs\wordpress-4.3\wp-includes\general-template.php"
        ["line"]=>
        int(171)
        ["function"]=>
        string(15) "locate_template"
        ["args"]=>
        array(3) {
          [0]=>
          &array(2) {
            [0]=>
            string(16) "content-page.php"
            [1]=>
            string(11) "content.php"
          }
          [1]=>
          &bool(true)
          [2]=>
          &bool(false)
        }
      }
      [11]=>
      array(4) {
        ["file"]=>
        string(70) "C:\xampp\htdocs\wordpress-4.3\wp-content\themes\twentyfifteen\page.php"
        ["line"]=>
        int(24)
        ["function"]=>
        string(17) "get_template_part"
        ["args"]=>
        array(2) {
          [0]=>
          &string(7) "content"
          [1]=>
          &string(4) "page"
        }
      }
      [12]=>
      array(4) {
        ["file"]=>
        string(61) "C:\xampp\htdocs\wordpress-4.3\wp-includes\template-loader.php"
        ["line"]=>
        int(75)
        ["args"]=>
        array(1) {
          [0]=>
          string(70) "C:\xampp\htdocs\wordpress-4.3\wp-content\themes\twentyfifteen\page.php"
        }
        ["function"]=>
        string(7) "include"
      }
      [13]=>
      array(4) {
        ["file"]=>
        string(48) "C:\xampp\htdocs\wordpress-4.3\wp-blog-header.php"
        ["line"]=>
        int(16)
        ["args"]=>
        array(1) {
          [0]=>
          string(61) "C:\xampp\htdocs\wordpress-4.3\wp-includes\template-loader.php"
        }
        ["function"]=>
        string(12) "require_once"
      }
      [14]=>
      array(4) {
        ["file"]=>
        string(39) "C:\xampp\htdocs\wordpress-4.3\index.php"
        ["line"]=>
        int(17)
        ["args"]=>
        array(1) {
          [0]=>
          string(48) "C:\xampp\htdocs\wordpress-4.3\wp-blog-header.php"
        }
        ["function"]=>
        string(7) "require"
      }
    }

    Thread Starter fb-creations

    (@fb-creations)

    Ok i performed it by replacing ‘page-id-7’ by the slug of the page

    Forum: Hacks
    In reply to: Probleme with formatting file
    Thread Starter fb-creations

    (@fb-creations)

    Hi
    this is my widget function for the form

    public function widget( $args, $instance ) {
            $cache = array();
            if ( ! $this->is_preview() ) {
                $cache = wp_cache_get( 'widget_alliance_build_posts', 'widget' );
            }
    
            if ( ! is_array( $cache ) ) {
                $cache = array();
            }
    
            if ( ! isset( $args['widget_id'] ) ) {
                $args['widget_id'] = $this->id;
            }
    
            if ( isset( $cache[ $args['widget_id'] ] ) ) {
                echo $cache[ $args['widget_id'] ];
                return;
            }
    
            ob_start();
    
            $title          = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'A new section', 'alliance' );
            /** This filter is documented in wp-includes/default-widgets.php */
            $title          = apply_filters( 'widget_title', $title, $instance, $this->id_base );
            $sectionID      = ( ! empty( $instance['sectionID'] ) ) ? $instance['sectionID'] : __( 'A new section', 'alliance' );
            $category       = $instance['category'];
            $display       = $instance['display'];
    
            ?><section id="<?php echo $sectionID; ?>"><?php
    
            echo $args['before_widget'];
            if ( $title ) {
                echo $args['before_title'] . $title . $args['after_title'];
            }
            if ( !empty( $category ) ) {
                echo '<form id="'. $this->get_field_id('category').'" method="get" action="">';
                $i = 1;
                foreach ($category as $tax) {
                    $terms = get_terms($tax);
                    switch ($display[$i]) {
                        case 'select':
                            ?>
                            <p>
                            <label for="<?php echo $this->get_field_id('category'); ?>"><?php echo $tax; ?></label>
                        <select id="<?php echo $tax; ?>" name="<?php echo $tax; ?>">
                            <option name="all" value=""><?php echo __('All'); ?></option>
                            <?php
                            foreach ($terms as $taxo => $values) {
                                //echo '<pre>' . var_dump($values->slug);
                                $selected = esc_attr($values->slug) ? ' selected = "selected" ' : '';
                                $option = '<option ' . $selected . 'value="' . $values->slug;
                                $option = $option . '">';
                                $option = $option . $values->slug;
                                $option = $option . '</option>';
                                echo $option;
                            }
                            echo '</select>';
                            break;
                        case 'checkbox':
                            echo '<p>';
                            $t = 0;
                            foreach ($terms as $taxo => $values) {
                                    echo '<label for="'. $this->get_field_id('category').'">'. $values->slug.'</label>';
                                echo '<input id="'. $this->get_field_id('category') . $values->slug.'"
                                       name="'. $tax.'[]" type="checkbox"
                                       value="'. $values->slug.'" '. checked('1', $values->slug).' />';
                                $t++;
                                    }
                            break;
                        case 'radio':
                            echo '<p>';
                            $t = 0;
                            foreach ($terms as $taxo => $values) {
                                echo '<label for="'. $this->get_field_id('category').'">'. $values->slug.'</label>';
                                echo '<input id="'. $this->get_field_id('category') . $values->slug.'"
                                       type="radio" name="'. $tax.'"
                                       value="'. $values->slug.'" '. checked('1', $values->slug).' />';
                                $t++;
                            }
                            break;
                        case 'range':
                            echo '<p>';
                            echo '<label for="'. $this->get_field_id('category').'">'. $tax.'</label>';
                            $input = '<input id="'. $this->get_field_id('category') . $tax.'" type="range" name="'. $tax.'"';
                            $a = 0;
                            $all_terms = array();
                            foreach ($terms as $taxo) {
                                //echo '<pre>' . var_dump($taxo->name);
                                array_push($all_terms, $taxo->name);
                                $min = min($all_terms);
                                $max = max($all_terms);
                                $a++;
                            }
                            $input .= 'min="'.$min.'" max="'.$max.'" step="1" />';
                            echo $input;
                            break;
                    } $i++;
                }
                    echo '</p><p><input type="submit" name="submit"/></p></form>';
            }
            //echo '<pre>'.var_dump($instance);
    
            echo $args['after_widget'];
    
            ?></section><?php
    
            if ( ! $this->is_preview() ) {
                $cache[ $args['widget_id'] ] = ob_get_flush();
                wp_cache_set( 'widget_alliance_build_posts', $cache, 'widget' );
            } else {
                ob_end_flush();
            }
        }

    this is my shortcode function for displaying results

    public static function sc_result_filter($atts) {
        if (!isset( $_GET['submit'] )) {
            $post_type = sc_list_post_type();
            extract(shortcode_atts(array(
                'post_type' => $post_type,
                'posts' => 1,
            ), $atts));
    
            $return_string = '<ul><pre>'.var_dump($post_type).'</pre>';
            query_posts(array('orderby' => 'date', 'order' => 'DESC' , 'showposts' => $posts, 'post_type' => $post_type));
            if (have_posts()) :
                while (have_posts()) : the_post();
                    $return_string .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
                endwhile;
            endif;
            $return_string .= '</ul>';
            wp_reset_query();
        }
        else {
            $post_type = sc_list_post_type();
            $tax_query = array();
            unset($_GET['submit']);
            foreach ($_GET as $k => $v ) {
                $tax_name = $k;
                $tax_value = $v;
                $tax_request = array(
                        'taxonomy'=>$tax_name,
                        'field'=>'slug',
                        'terms'=>array($tax_value),
                        'operator'=>'IN'
                    );
    
                $tax_query[] = $tax_request;
            }
            extract( shortcode_atts(
                    $args = array(
                        'post_type' => $post_type,
                        'tax_query' => $tax_query
                    ), $atts )
            );
            $output = '';
            $query = new WP_Query($args);
            echo '<pre>';
            echo var_dump($query).'<pre>';
            if ($query->have_posts()) :
                $output .= '<div class="results"><ul><pre>'.var_dump($tax_query).'</pre>';
                while ($query->have_posts()) : $query->the_post();
                    $output .= '<li><div class="image">'.get_the_post_thumbnail().'</div>';
                    $output .= '<a href="'.get_permalink().'">'.get_the_title().'</a></li>';
                endwhile;
                $output .= '</div>';
            endif;
            wp_reset_postdata();
            return $output;
        }
        return $return_string;
        }

    It is not really finished but checkbox works fine when i don’t use[]. How can i perform this ?

    Thread Starter fb-creations

    (@fb-creations)

    Okay, thank you i finally found it in theme.php
    At start i thought to had to manage $controls->checkbox in theme-options.php but it was so more easy ! I just don’t read enought theme.php
    Sorry for disturbing

    Thread Starter fb-creations

    (@fb-creations)

    Thank you for your answer, i have some skills for editing a theme, but i don’t know the good method to use, i tried width the_content() but it doesn’t works can you give me the right way please ?

    Plugin Author fb-creations

    (@fb-creations)

    I added more screenshots, if you have others questions feel free to ask.

    Plugin Author fb-creations

    (@fb-creations)

    Plugin Author fb-creations

    (@fb-creations)

    This plugin allow you to create other “posts types” than Posts. It can be usefull when you want to manage items in custom catégories.
    For exemples a cooking recipe site or a real estate site.

    If you have to new post type like “houses” and “flats” to manage in new types of categories named “for sale” and “for rent” ; Your products are not in a sub-category of “categories”. This is very usefull to sort and filter this without having normal posts mixed whit them.
    Moreover, WordPress allow to make custom template file for custom post type easy by copy single.php in single-myposttype.php in order to get a layout different than normal posts. For exemple you can display post meta from metaboxes…

    I will make a demo site later because i miss time, maybe next month.

    Hi, it doesn’t works with min/max slider i just have 2 ranges :
    min-min and min-max but not all ranges by incrementation what’s wrong ? (i am on 2.6.0 version of the plugin)

Viewing 15 replies - 1 through 15 (of 17 total)