• Resolved elbrucko

    (@elbrucko)


    your plugin list category posts works very fine: exactly where i enter the shortcode, the output appairs on the frontend.
    But list categories doesnt work in this way.
    Ive entered the shortcode somewhere at the buttom of the page, but the output appairs on TOP.
    Your recerece according to markup and styling is not helpful. Additionally i am planning to include the shortcode on several pages, so changing the .css file will fix it for one page, but not for all of the others.

    This is what ive entered: [categories child_of=1 orderby=count show_count=1 hide_empty=1 feed=RSS]

    Please provide a solution that the output will appair exactly at the point where ive entered it in backend.
    thanks in advance.

    https://www.ads-software.com/plugins/list-categories/

Viewing 4 replies - 1 through 4 (of 4 total)
  • windwww

    (@windwww)


    Above provides the solution:

    and I applied to this plugin:

    <?php
    /*
      Plugin Name: List Categories
      Plugin URI: https://github.com/picandocodigo/List-Categories
      Description: Simple plugin to display categories in any post or page
      with a shortcode. It's basically a shortcode API interface to the
      wp_list_categories WordPress function.
      Version: 0.1
      Author: Fernando Briano
      Author URI: https://picandocodigo.net/
    
      Copyright 2014  Fernando Briano  (email : [email protected])
    
      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 3 of the License, or
      any later version.
    
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.
    
      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    */
    class ListCategories{
      static function list_categories($atts, $content = null) {
        ob_start();
    
        $atts = shortcode_atts(
          array(
            'show_option_all'    => '',
            'orderby'            => 'name',
            'order'              => 'ASC',
            'style'              => 'list',
            'show_count'         => 0,
            'hide_empty'         => 1,
            'use_desc_for_title' => 1,
            'child_of'           => 0,
            'feed'               => '',
            'feed_type'          => '',
            'feed_image'         => '',
            'exclude'            => '',
            'exclude_tree'       => '',
            'include'            => '',
            'hierarchical'       => 1,
            'title_li'           => __( 'Categories' ),
            'show_option_none'   => __( 'No categories' ),
            'number'             => null,
            'echo'               => 1,
            'depth'              => 0,
            'current_category'   => 0,
            'pad_counts'         => 0,
            'taxonomy'           => 'category',
            'walker'             => null
          ), $atts
        );
        wp_list_categories($atts);
        $output = ob_get_contents();
        ob_end_clean();
        return $output;
      }
    }
    
    add_shortcode( 'categories', array('ListCategories', 'list_categories') );
    
    ?>
    windwww

    (@windwww)

    This is a good and easy to use shortcode!

    Plugin Author Fernando Briano

    (@fernandobt)

    This issue has been fixed on version 0.2. Please update your plugins and open a new topic on the forum if the issue persists. Thanks!

    Thanks windwww for pointing me in the right direction with this issue.

    fernandobt,
    Thanks for your contribution! It is a good plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wrong placement’ is closed to new replies.