danke!
ich habs grad nach längerem suchen hier im forum gefunden!
<?php wswwpx_fold_page_list('[COLOR=Red]&sort_column=menu_order[/COLOR][COLOR=Blue]&include=4,7,23[/COLOR]'); ?>
jetzt gehts!
Aber danke trotzdem! :-D
Um schreiben oder kommentieren zu können, benötigen Sie ein Benutzerkonto.
Sie haben schon ein Benutzerkonto? Melden Sie sich hier an.
Jetzt anmeldenHier können Sie ein neues Benutzerkonto erstellen.
Neues Benutzerkonto erstellendanke!
ich habs grad nach längerem suchen hier im forum gefunden!
<?php wswwpx_fold_page_list('[COLOR=Red]&sort_column=menu_order[/COLOR][COLOR=Blue]&include=4,7,23[/COLOR]'); ?>
jetzt gehts!
Aber danke trotzdem! :-D
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
Ja. Der "hierarchical"-Parameter muss gesetzt sein, der Rest ist CSS.
Template Tags/wp list categories WordPress Codex
Danke! Nur bekomme ich das leider nicht hin :???:
Wo muss ich die Änderung denn genau vornehmen?
<?php
/*
Plugin Name: Folding Pages Widget
Plugin URI: [URL]http://navyroad.com/wordpress-plugins/nrs-folding-pages-widget/[/URL]
Description: Provides a hierarchical list of pages for your sidebar.
Author: Chris Carson
Version: 1.0
Author URI: [URL="http://navyroad.com"]Navy Road Home[/URL]
Credits: Thanks to Andy Skelton. Based on code by Erwin Harte ([URL="http://is-here.com/projects/wordpress/pages"]East of the Sun, West of the Moon :: Wordpress - Custom Pages Widget[/URL]) Calvin Yu ([URL="http://blog.codeeg.com/"]Don't Forget to Plant It! —[/URL])
*/
function nrs_folding_pages($args){
extract($args);
//var_dump($args);
$sort_opts = nrs_folding_pages_get_sort_opts();
$options = get_option("nrs_folding_pages");
$title = (empty($options["title"])) ? null : $options["title"];
$sort_column = (array_key_exists($options["sort_column"],$sort_opts)) ? $options["sort_column"] : key($sort_opts);
global $notfound;
global $post;
//returns a numerically indexed array...
$pages = get_pages("sort_column=$sort_column");
//a new associative array indexed by ID...
$nodes = array();
foreach ($pages as $page) $nodes[$page->ID] = $page;
//an array to hold the parent ids in the current tree...
$parent_ids = array();
if (is_page() and ($notfound != '1'))
{
$curr_page_id = $post->ID;
while ($curr_page_id)
{
array_unshift($parent_ids, $curr_page_id );
$curr_page_id = $nodes[$curr_page_id]->post_parent;
}
}
//add the top-level parent id, which is 0...
array_unshift($parent_ids, 0 );
//output...
echo $before_widget;
echo $before_title . $title . $after_title;
nrs_display_tree($parent_ids, $nodes, 0);
echo $after_widget;
}
function nrs_display_tree($parent_ids, $nodes, $curr_id)
{
global $post;
if ($curr_id)
{
$node = $nodes[$curr_id];
$title = wp_specialchars($node->post_title);
$link = get_page_link($curr_id);
$class = "page_item";
if ($curr_id == $post->ID) $class .= " current_page_item";
echo "<li class=\"$class\"><a href=\"$link\" title=\"$title\">$node->post_title</a>";
}
if (in_array($curr_id, $parent_ids))
{
$num_children = 0;
foreach ($nodes as $node)
{
if ($node->post_parent == $curr_id)
{
if (! $num_children) echo "\n<ul>";
nrs_display_tree($parent_ids, $nodes, $node->ID);
$num_children++;
}
}
if ($num_children) echo "</ul>\n";
}
if ($curr_id) echo "</li>\n";
}
function nrs_folding_pages_get_sort_opts() {
return array( "post_title"=>"Title",
"menu_order"=>"Page Order");
}
function nrs_folding_pages_control() {
$sort_opts = nrs_folding_pages_get_sort_opts();
$options = get_option("nrs_folding_pages");
if ( $_POST['nrs_folding_pages_submit'] )
{
$options['title'] = strip_tags(stripslashes($_POST['nrs_folding_pages_title']));
$options['sort_column'] = (array_key_exists($_POST['nrs_folding_pages_sort_column'], $sort_opts)) ? $_POST['nrs_folding_pages_sort_column'] : key($sort_opts);
update_option('nrs_folding_pages', $options);
}
$sort_column = (array_key_exists($options["sort_column"],$sort_opts)) ? $options["sort_column"] : key($sort_opts);
$title = wp_specialchars($options['title']);
?>
<input type="hidden" id="nrs_folding_pages_submit" name="nrs_folding_pages_submit" value="1" />
<p><label for="nrs_folding_pages_title"><?php _e('Title:'); ?> <input style="width: 250px;" id="nrs_folding_pages_title" name="nrs_folding_pages_title" type="text" value="<?php echo $title; ?>" /></label></p>
<p><label for="nrs_folding_pages_sort_column">
<?php _e('Sort:'); ?>
<select id="nrs_folding_pages_sort_column" name="nrs_folding_pages_sort_column">
<?php
foreach ($sort_opts as $val=>$label){
echo "<option value=\"$val\"";
if ($sort_column == $val) echo " selected";
echo ">$label</option>";
}
?>
</select>
</label></p>
<?php
}
function nrs_folding_pages_init()
{
register_sidebar_widget("NRS Folding Pages", "nrs_folding_pages");
register_widget_control("NRS Folding Pages", "nrs_folding_pages_control");
}
add_action("plugins_loaded", "nrs_folding_pages_init");
?>
Alles anzeigen
Vielen vielen Dank schonmal,
mfG,
koffer
Ich meinte dort, wo du die Pluginfunktion aufrufst muss der hierarchical-Parameter in der Argumentenliste gesetzt sein. Und alles andere ist wie gesagt CSS, d.h. style.css deines Themes.
Es funktioniert einfach nicht...
Mein Theme ist "Vertigo". Sobald ich z.B. das normale WP-Theme nehme, ist alles wunderbar, d.h. die zweite Ebene wird eingerückt :confused:
Ich habe eine l_sidebar.php, in der das Widget (Folding Pages (Navy Road)) erscheint:
<!-- begin l_sidebar -->
<div id="l_sidebar">
<ul id="l_sidebarwidgeted">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
<li id="Categories">
<h2><?php _e('Themen','vertigo');?></h2>
<ul>
<?php wp_list_cats('sort_column=name'); ?>
</ul>
</li>
<li id="Recent">
<h2><?php _e('Recently Written','vertigo');?></h2>
<ul>
<?php get_archives('postbypost', 10); ?>
</ul>
</li>
<li id="Archives">
<h2><?php _e('Archives','vertigo');?></h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
<li id="Blogroll">
<h2><?php _e('Blogroll','vertigo');?></h2>
<ul>
<?php get_links(-1, '<li>', '</li>', ' - '); ?>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
<!-- end l_sidebar -->
Alles anzeigen
und eine r_sidebar.php.
Die style.css sieht so aus:
/*
Theme Name: Vertigo Enhanced
Theme URL: [URL="http://www.briangardner.com/themes/vertigo-wordpress-theme.htm"]Vertigo WordPress Theme : Brian Gardner[/URL]
Description: Vertigo Enhanced is a modern, 3-column Widget-ready theme created for Wordpress.
Author: Brian Gardner
Author URI: [URL="http://www.briangardner.com"]Brian Gardner[/URL]
Version: 2.0
*/
body {
background: #FFFFFF url(images/bg.gif) repeat-x;
color: #000000;
font-size: 12px;
font-family: Arial, Helvetica, Sans-Serif;
margin: 0px auto 0px;
padding: 0px;
}
#wrap {
background: #FFFFFF;
width: 960px;
margin: 0px auto 0px;
padding: 0px;
}
/************************************************
* Navbar *
************************************************/
#navbar {
background: #FFFFFF url(images/header.gif);
width: 960px;
height: 160px;
margin: 0px auto 0px;
padding: 0px;
overflow: hidden;
}
#navbar img a{
margin: 0px;
border: none;
}
#navbarleft {
background: #FFFFFF url(images/logo.gif);
height: 160px;
width: 160px;
float: left;
margin: 0px;
padding: 0px;
}
#navbarright {
width: 800px;
float: right;
text-align: right;
margin: 0px;
padding: 10px 0px 0px 0px;
}
#navbarright li {
display: inline;
list-style-type: none;
margin: 0px;
padding: 0px;
}
#navbarright ul {
margin: 0px;
padding: 0px;
}
#navbarright a, #navbarright a:visited {
color: #FFFFFF;
font-weight: bold;
margin: 0px;
padding: 6px 10px 6px 10px;
text-decoration: none;
}
#navbarright a:hover {
color: #FFFFFF;
font-weight: bold;
text-decoration: underline;
}
/************************************************
* Content *
************************************************/
#content {
width: 960px;
margin: 0px auto 0px;
padding: 0px;
}
#content p{
padding: 0px 0px 15px 0px;
margin: 0px;
line-height: 20px;
}
#content h1 {
color: #000000;
font-size: 22px;
font-family: Century Gothic, Verdana, Arial, Sans-Serif;
font-weight: normal;
margin: 25px 0px 0px 0px;
padding: 20px 0px 10px 0px;
border-top: 2px solid #000000;
}
#content h1 a {
color: #000000;
text-decoration: none;
}
#content h1 a:hover {
color: #990000;
text-decoration: none;
}
#content p img{
float: left;
border: none;
margin-right: 15px;
margin-bottom: 10px;
}
#content h3 {
color: #000000;
font-size: 22px;
font-family: Century Gothic, Verdana, Arial, Sans-Serif;
font-weight: normal;
margin: 25px 0px 0px 0px;
padding: 20px 0px 10px 0px;
}
#content img.wp-smiley {
float: none;
border: none;
padding: 0px;
margin: 0px;
}
#content img.wp-wink {
float: none;
border: none;
padding: 0px;
margin: 0px;
}
#contentleft {
float: left;
width: 470px;
margin: 0px 0px 0px 0px;
padding: 0px 0px 20px 0px;
}
#contentleft ol{
margin: 0px 0px 0px 20px;
padding: 0px 0px 10px 0px;
}
#contentleft ol li{
margin: 0px 0px 0px 20px;
padding: 0px 0px 0px 0px;
}
#contentleft ul{
list-style-type: square;
margin: 0px 0px 0px 20px;
padding: 0px 0px 10px 0px;
}
#contentleft ul li{
list-style-type: square;
margin: 0px 0px 0px 20px;
padding: 0px 0px 0px 0px;
}
blockquote{
margin: 0px 25px 10px 25px;
padding: 0px 25px 0px 10px;
background: #E8E8E8;
border-top: 2px solid #000000;
border-bottom: 1px solid #000000;
}
#content blockquote p{
margin: 0px 0px 10px 0px;
padding: 10px 0px 0px 0px;
}
/************************************************
* Left Sidebar *
************************************************/
#l_sidebar {
float: left;
width: 225px;
margin: 25px 0px 0px 20px;
padding: 0px 0px 20px 0px;
border-top: 2px solid #000000;
}
#l_sidebar ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#l_sidebar ul li {
display: inline;
padding: 0px;
margin: 0px;
}
#l_sidebar ul li a {
display: block;
color: #000000;
text-decoration: none;
margin: 0px;
padding: 5px 0px 5px 0px;
border-bottom: 1px solid #C0C0C0;
}
#l_sidebar ul li a:hover {
background: #EFEFEF;
color: #990000;
}
#l_sidebar p{
padding: 3px 0px 0px 0px;
margin: 0px;
line-height: 20px;
}
#folding_category_list li ul li {margin-left:8px;}
/************************************************
* Right Sidebar *
************************************************/
#r_sidebar {
float: right;
width: 225px;
margin: 25px 0px 0px 20px;
padding: 0px 0px 20px 0px;
border-top: 2px solid #000000;
}
#r_sidebar ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#r_sidebar ul li {
display: inline;
padding: 0px;
margin: 0px;
}
#r_sidebar ul li a {
display: block;
color: #000000;
text-decoration: none;
margin: 0px;
padding: 5px 0px 5px 0px;
border-bottom: 1px solid #C0C0C0;
}
#r_sidebar ul li a:hover {
background: #EFEFEF;
color: #990000;
}
#r_sidebar p{
padding: 3px 0px 0px 0px;
margin: 0px;
line-height: 20px;
}
/************************************************
* Footer Background *
************************************************/
#footerbg {
background: #990000;
}
/************************************************
* Footer *
************************************************/
#footer {
width: 960px;
height: 100px;
background: #990000;
color: #FFFFFF;
margin: 0px auto 0px;
text-align: left;
position: relative;
line-height: 17px;
}
#footer p {
color: #FFFFFF;
padding: 0px;
list-style-type: none;
margin: 0px;
}
#footer h3 {
color: #FFFFFF;
font-size: 12px;
font-family: Arial, Helvetica, Sans-Serif;
font-weight: bold;
border-bottom: 2px solid #666666;
padding: 0px 0px 2px 0px;
margin: 15px 0px 3px 0px;
text-transform: uppercase;
}
#footer a {
color: #AAAAAA;
text-decoration: none;
}
#footer a:hover {
color: #FFFFFF;
text-decoration: none;
}
#footer ul {
list-style: none;
margin: 0px 0px 0px 0px;
padding: 0px;
}
#footer ul li {
display: inline;
padding: 0px;
margin: 0px;
}
#footer ul li a {
display: block;
color: #FFFFFF;
text-decoration: none;
margin: 0px;
padding: 5px 0px 5px 0px;
border-bottom: 1px solid #666666;
}
#footer ul li a:hover {
background: #333333;
color: #FFFFFF;
}
#footerleft {
background: #990000;
float: left;
width: 225px;
margin: 0px 20px 0px 0px;
padding: 0px;
}
#footermiddle1 {
background: #990000;
float: left;
width: 225px;
margin: 0px 20px 0px 0px;
padding: 0px;
}
#footermiddle2 {
background: #990000;
float: left;
width: 225px;
margin: 0px 20px 0px 0px;
padding: 0px;
}
#footerright {
background: #990000;
float: right;
width: 225px;
margin: 0px 0px 0px 0px;
padding: 0px;
}
/************************************************
* Search Form *
************************************************/
#searchdiv {
margin: 0px;
padding 0px;
}
#searchform {
margin: 0px;
padding: 0px;
overflow: hidden;
}
#s {
background: #EFEFEF url(images/search.gif);
color: #333333;
font-size: 11px;
font-family: Verdana, Helvetica, Sans-Serif;
padding: 2px;
margin: 4px 0px 0px 0px;
border: 1px solid #C0C0C0;
}
#sbutt {
background: #878787;
color: #FFFFFF;
font-size: 11px;
font-family: Verdana, Helvetica, Sans-Serif;
padding: 1px;
margin: 0px 0px 0px 5px;
border: 1px solid #333333;
}
/************************************************
* Comments *
************************************************/
#commentblock {
width: 430px;
background: #E8E8E8;
color: #000000;
float: left;
padding: 20px 20px 10px 20px;
margin: 10px 0px 0px 0px;
border-top: 2px solid #000000;
border-bottom: 1px solid #000000;
}
#commentblock ol{
list-style-type: square;
margin: 0px 0px 0px 0px;
padding: 0px 0px 10px 0px;
}
.commentdate {
font-size: 12px;
padding-left: 0px;
}
#commentlist li p{
margin-bottom: 8px;
line-height: 20px;
padding: 0px;
}
.commentname {
color: #333333;
margin: 0px;
padding: 5px 5px 5px 0px;
}
.commentinfo{
clear: both;
}
.commenttext {
clear: both;
margin: 3px 0px 10px 0px;
padding: 20px 10px 5px 10px;
width: 380px;
background: #FFFFFF url(images/comment.gif) no-repeat top;
}
.commenttext-admin {
clear: both;
margin: 3px 0px 10px 0px;
padding: 20px 10px 5px 10px;
width: 380px;
background: #FFFFFF url(images/comment.gif) no-repeat top;
}
#commentsformheader{
padding-left: 0px;
}
#commentsform{
text-align: center;
margin: 0px;
padding: 0px;
}
#commentsform form{
text-align: left;
margin: 0px;
}
#commentsform p{
margin: 0px;
}
#commentsform form textarea{
width: 99%;
}
p.comments_link img{
margin: 0px;
padding: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
Alles anzeigen
Wo muss ich denn was einfügen?
Sorry, aber ich blicke nicht durch...
Danke,
mfG,
koffer
Ich habe eine l_sidebar.php, in der das Widget (Folding Pages (Navy Road)) erscheint:
Widget? Ich kenne das Widget nicht. Beim Standard-Kategorienwidget gibts einen Haken für hierarchische Ansicht. Werden denn die Kategorien im HTML-Quelltext deiner Seite korrekt verschachtelt?
ZitatMein Theme ist "Vertigo". Sobald ich z.B. das normale WP-Theme nehme, ist alles wunderbar, d.h. die zweite Ebene wird eingerückt :confused:
Nutzt du beim Default-Theme auch dieses Widget?
ZitatWo muss ich denn was einfügen?
CSS ist am besten am Live-Patienten zu debuggen.
CSS ist am besten am Live-Patienten zu debuggen.
Meinst du, das geht zB mit dem Firebug?
Ich habe dasselbe Problem. Mein Wordpress befindet sich unter http://wp.o-r-c-a.at
Mein Ziel: 2. Ebene eingerückt und kursiv
Sag mal, wenn ich direkt mit dem Firebug Änderungen an meiner HP machen kann, könnte das auch jeder andere? Wie kann ich das verhindern?
Meinst du, das geht zB mit dem Firebug?
Zum Beispiel, ja.
ZitatIch habe dasselbe Problem. Mein Ziel: 2. Ebene eingerückt und kursiv
Ist zwar mit Seiten, macht aber nix. So gehts:
ZitatSag mal, wenn ich direkt mit dem Firebug Änderungen an meiner HP machen kann, könnte das auch jeder andere? Wie kann ich das verhindern?
Was willst du verhindern? Firebug kann die Änderungen logischerweise nicht bei dir abspeichern. Es ist nur ein Debugging-Tool für lokale Änderungen.
ich hab zwar versucht, das irgendwo passend einzufügen, aber ich weiß nun schlussendlich nicht, wo...
Das Seiten-Widget muss ich nun im style.css editieren oder muss ich das direkt im nrs-folding-pages machen? Im Sidebar (sidebar.php) finde ich das nicht. Oder muss ich das widget direkt editieren? Ich werde aus Firebug nicht schlau (leider)...
Welche Infos benötigst du, damit du mir das genau sagen kannst? Ich steige hier komplett aus. :cry:
Das wars, funktioniert!
Vielen Dank!
MfG,
koffer
Das wars, funktioniert!
Vielen Dank!
MfG,
koffer
Bitte schreib kurz, auf welcher Seite du das eingefügt hast?
hmmm. irgend etwas läuft bei mir falsch. Weil da tut sich auch nach dem Einfügen des Codes GAR NIX. :-? :oops:
Ich hab den Code eingefügt - vorher hab ich übrigens nix gefunden, das auch im Entferntesten nach nrs-folding-pages ausschaut... - und es gab keine Änderungen.
Könnte sich das jemand noch mal bei mir anschauen? xxxhttp://wp.o-r-c-a.at/
Ich finde nichts was ich ersetzen muss.
keine spur von <?php wp_list_pages ($arglist); ?> :
<div id="sidebar">
<ul>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
<li>
<h2><?php _e('Categories'); ?></h2>
<ul>
<?php wp_list_cats('sort_column=name&hierarchical=0'); ?>
</ul>
</li>
<li>
<h2><?php _e('Archives'); ?></h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
<li>
<h2><?php _e('Links'); ?></h2>
<ul>
<?php get_links(2, '<li>', '</li>', '', TRUE, 'url', FALSE); ?>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
Alles anzeigen
hmmm. irgend etwas läuft bei mir falsch. Weil da tut sich auch nach dem Einfügen des Codes GAR NIX. :-? :oops:
Ich hab den Code eingefügt - vorher hab ich übrigens nix gefunden, das auch im Entferntesten nach nrs-folding-pages ausschaut... - und es gab keine Änderungen.
Die ID heißt #nrs[COLOR="Red"]-[/COLOR]folding[COLOR="#ff0000"]-[/COLOR]pages, bei dir im Stylesheet steht aber:
#nrs[B][COLOR="#ff0000"]_[/COLOR][/B]folding[B][COLOR="#ff0000"]_[/COLOR][/B]pages ul { /* 1. Ebene */
margin-right:10px;
}
#nrs[B][COLOR="#ff0000"]_[/COLOR][/B]folding[B][COLOR="#ff0000"]_[/COLOR][/B]pages ul ul { /* 2. Ebene */
margin-right:8px;
}
Rückenschmerzen: Nutzt du Widgets in deinem Theme? dann musst du auch die entsprechenden Widgets benutzen (sind hier im Thread verlinkt).
Rückenschmerzen: Nutzt du Widgets in deinem Theme? dann musst du auch die entsprechenden Widgets benutzen (sind hier im Thread verlinkt).
ja.
Ok,ich habe nun Navy Road Folding Pages Widget installiert.
Jetzt zerhauts mir das Layout, also der Contentbereich ist nun unter der Menüleiste.
Ein Menüpunkt taucht neu unter der Menüleiste auf.
URL zum Blog? Ohne kann man wenig sagen.
URL zum Blog? Ohne kann man wenig sagen.
Da kommt sich das Widget mit den Definitionen für die Seiten in die Quere. Du musst ebenfalls entsprechend deine CSS-Regeln anpassen.
ZitatEin Menüpunkt taucht neu unter der Menüleiste auf.
Das ist das Widget. Weiter oben hast du eine statische Seitenleiste. Die steht aber vor <div id="sidebar">, kann durchaus sein, dass das bei dir ne andere Template-Datei ist. Vielleicht kannst du auch dort den Plugin-Code einfügen/ersetzen.
Die ID heißt #nrs[COLOR=Red]-[/COLOR]folding[COLOR=#ff0000]-[/COLOR]pages, bei dir im Stylesheet steht aber:
Ich trau mich gar nicht, noch mal zu posten. ABER in jedem anderen Theme (defautl, wp_andreas01) habe jetzt das richtige Ergebnis. Nur im wp_andreas09 funktioniert das nicht... Echt schade. Denn in der Vorschau des wp_andreas 09 sah die Seiten-Geschichte anders aus, als nach der Verwendung von Widgets... Gibt es da noch eine einfache Lösung? Sonst geb ich auf und verwende ein anderes Thema.
Ich trau mich gar nicht, noch mal zu posten. ABER in jedem anderen Theme (defautl, wp_andreas01) habe jetzt das richtige Ergebnis. Nur im wp_andreas09 funktioniert das nicht... Echt schade. Denn in der Vorschau des wp_andreas 09 sah die Seiten-Geschichte anders aus, als nach der Verwendung von Widgets... Gibt es da noch eine einfache Lösung? Sonst geb ich auf und verwende ein anderes Thema.
So sieht dein Style in Opera Dragonfly aus:
und so direkt in der style.css:
Also irgendwas musst du dort schon eintragen, sonst ändert sich logischerweise auch nix. ;-)
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!