Wpis z mikrobloga

#webdev #wordpress #pytaniedoeksperta

Mireczki, problem przeogromny.
1. Statyczna podstrona, w niej osadzony wrzucony shortcode:

[advancedCategoryDetailsSelection cat="23"]
2. We wtyczce zdefiniowany kod w taki sposób:

function advCatDetSel_func( $atts ) {
$a = shortcode_atts( array('cat' => 'empty',), $atts );
$args = array(
'show_option_all' => '',
'orderby' => 'name',
'order' => 'ASC',
'style' => 'list',
'show_count' => 1,
'hide_empty' => 1,
'use_desc_for_title' => 1,
'child_of' => $a[cat],
'feed' => '',
'feed_type' => '',
'feed_image' => '',
'exclude' => '',
'exclude_tree' => '',
'include' => '',
'hierarchical' => 1,
'title_li' => null,
'show_option_none' => __( '' ),
'number' => null,
'echo' => 1,
'depth' => 0,
'current_category' => 0,
'pad_counts' => 0,
'taxonomy' => 'category',
'walker' => null
);
wp_list_categories( $args );
}
add_shortcode( 'advancedCategoryDetailsSelection', 'advCatDetSel_func' );
Lista wygląda super, ale problem polega na tym, że na statycznej stronie listę kategorii wrzuca zawsze na samym początku contentu, niezależnie od tego jak nisko w treści umieszczam shortcode.
  • 5