Guten Abend,
ich habe jetzt schon diverse Tuts und Forenbeiträge durchgelesen, aber leider ist das Ergebnis bisher absolut ernüchternd.
Aus einer ehem. php Seite die ich entworfen habe wurde ein Theme (nach der Entdeckung von Wordpress...:wink:)
Ich habe folgende Meldung:
ZitatDein aktuell genutztes Theme unterstützt keine Widgets. Das bedeutet, dass es keine Sidebar gibt (???), die du ändern könntest. Was du machen musst, damit dein Theme Widgets unterstützt, kannst du hier nachlesen.
Soweit so gut... dies dürfte wohl bekannt sein.
Meine sidebar.php
<?php global $url;
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) :
wp_meta(); ?>
<ul id="sidebar" class="nav">
<div align="center" class="content-sidebar widget-area" role="complementary">
<?php require_once('includes/mainlogo.php'); ?>
<br />
<span class="ortswahl">
<a href="/">
<img src="<?php echo $url; ?>/img/westhausen.svg" alt="Kirche Westhausen" width="54px" />
</a>
<a href="/">
<img src="<?php echo $url; ?>/img/lauchheim.svg" alt="Kirche Lauchheim" width="78px" />
</a>
<a href="/">
<img src="<?php echo $url; ?>/img/lippach.svg" alt="Kirche Lippach" width="54px" />
</a>
<a href="/">
<img src="<?php echo $url; ?>/img/roettingen.svg" alt="Kirche Röttingen" width="72px" />
</a>
<a href="/">
<img src="<?php echo $url; ?>/img/huelen.svg" alt="Kirche Hülen" width="54px" />
</a>
</span>
</div>
<?php endif;
my_wp_list_categories('orderby=name&title_li=');
?>
</ul>
Alles anzeigen
Meine functions.php
<?php
/**
* Register our sidebars and widgetized areas.
*
*/
if ( function_exists('register_sidebar') )
register_sidebar();
function arphabet_widgets_init() {
register_sidebar( array(
'name' => 'Home right sidebar',
'id' => 'home_right_1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
/**
* Definition des Seitenpfades.
*
*/
$url = get_bloginfo('template_url');
/**
* Category.
*
*/
function my_wp_list_categories( $args = '' ) {
$defaults = array(
'show_option_all' => '', 'show_option_none' => __('No categories'),
'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' => '', 'current_category' => 0,
'hierarchical' => true, 'title_li' => __( 'Categories' ),
'echo' => 1, 'depth' => 0,
'taxonomy' => 'category'
);
$r = wp_parse_args( $args, $defaults );
if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] )
{
$r['pad_counts'] = true;
}
if ( true == $r['hierarchical'] )
{
$r['exclude_tree'] = $r['exclude'];
$r['exclude'] = '';
}
if ( ! isset( $r['class'] ) )
{
$r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
}
if ( ! taxonomy_exists( $r['taxonomy'] ) )
{
return false;
}
$show_option_all = $r['show_option_all'];
$show_option_none = $r['show_option_none'];
$categories = get_categories( $r );
$output = '';
if ( $r['title_li'] && 'list' == $r['style'] )
{
$output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li'] . '<ul>';
}
if ( empty( $categories ) )
{
if ( ! empty( $show_option_none ) )
{
if ( 'list' == $r['style'] )
{
$output .= '<li class="cat-item-none">' . $show_option_none . '</li>';
}
else
{
$output .= $show_option_none;
}
}
}
else
{
if ( ! empty( $show_option_all ) )
{
$posts_page = ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) ? get_permalink( get_option( 'page_for_posts' ) ) : home_url( '/' );
$posts_page = esc_url( $posts_page );
if ( 'list' == $r['style'] )
{
$output .= "<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>";
}
else
{
$output .= "<a href='$posts_page'>$show_option_all</a>";
}
}
if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) )
{
$current_term_object = get_queried_object();
if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy )
{
$r['current_category'] = get_queried_object_id();
}
}
if ( $r['hierarchical'] )
{
$depth = $r['depth'];
}
else
{
$depth = -1; // Flat.
}
$output .= walk_category_tree( $categories, $depth, $r );
}
if ( $r['title_li'] && 'list' == $r['style'] )
{
$output .= '</ul></li>';
}
/**
* Filter the HTML output of a taxonomy list.
*
* @since 2.1.0
*
* @param string $output HTML output.
* @param array $args An array of taxonomy-listing arguments.
*/
$html = apply_filters( 'wp_list_categories', $output, $args );
/* Modify menu tree and add carousel aer 24.11.14 */
$cur_cat = $_GET["cat"];
$map = array("2"=>2,
"3"=>-1,
"4"=>5);
if(ctype_digit($cur_cat) && $cur_cat>0)
{
$pos = strpos($html,"cat-item-".$cur_cat);
if($pos!==false && $pos>-1)
{
$pos2 = strpos($html,"</li>",$pos);
$query = '[wonderplugin_carousel id='.$map[$cur_cat].']';
$carousel = do_shortcode($query);
if(strpos($carousel,"The specified carousel id does not exist") === false)
{
$html = substr($html,0,$pos2)."<div id=\"carousel-cat-item-".$cur_cat."\" class=\"carousel-placeholder\">".$carousel."
</div>".substr($html,$pos2);
}
}
}
/* Modification end */
if ( $r['echo'] )
{
echo $html;
}
else
{
return $html;
}
}
?>
Alles anzeigen
Diverse Möglichkeiten habe ich schon versucht. Was aber dazu führte das dann entweder die Sidebar samt footer nicht mehr funktionierten, oder das sich einfach nichts änderte.
Selbst in den vorhandenen Themes die Wordpress mitbringt habe ich inzwischen ein Blick geworfen und finde keine großen Unterschiede in den Aufrufen.
Da ich vielleicht vor lauter Code-Bäumen den Wald nicht mehr sehe, bitte ich Euch um Hilfe wo mein Denkfehler liegt oder was mir fehlt (mal abgesehen von dem Durchblick in WP :wink:)