1. Problem: Anordnung/Reihenfolge der TOP Navigation.
Erledigt. s.http://en.support.wordpress.com/menus/
In dem Theme kann man eigene Menüs definieren und sortieren...
Und ich Idiot hab stundenlang im sourcecode gesucht ^^
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 erstellen1. Problem: Anordnung/Reihenfolge der TOP Navigation.
Erledigt. s.http://en.support.wordpress.com/menus/
In dem Theme kann man eigene Menüs definieren und sortieren...
Und ich Idiot hab stundenlang im sourcecode gesucht ^^
2. Problem: Kürzung von Beiträgen -> Gelöst
Lösung des Problems:
in der Config.ini folgende Tags hinzugefügt:
excerpt_allowed_tags = "object,param,embed,a,img,abbr,blockquote,b,cite,pre,code,em,label,i,p,span,strong,ul,ol,li,"
Ich verstehe nicht genau was du willst.
1. Link zu deinem Blog bitte.
2. Beschreibe genau was du geändert haben willst oder anders machen möchtest.
wp-content\themes\flashglobeblue\core\navigation.php
<?php
function art_get_menu_auto($theme_location = 'primary-menu', $source='Pages', $Subitems = 'true', $menu = null)
{
$depth = (!$Subitems ? 1 : 0);
if (($source != 'Custom Menu') && function_exists('wp_nav_menu')) {
$locations = get_nav_menu_locations();
if ($locations && isset( $locations[ $theme_location ] ) ) {
$nav = wp_get_nav_menu_object($locations[$theme_location]);
if($nav){
$source = 'Custom Menu';
$menu = $nav;
}
}
}
return art_get_menu($source, $depth, $menu);
}
function art_get_menu($source='Pages', $depth = 0, $menu = null)
{
if ($source == 'Custom Menu' && function_exists('wp_nav_menu') && $menu) {
return art_get_list_menu( array( 'menu' => $menu, 'depth' => $depth));
}
if ($source == 'Pages') {
return art_get_list_pages(array('depth' => $depth, 'sort_column' => 'menu_order'));
}
if ($source == 'Categories') {
return art_get_list_categories(array('title_li'=> false, 'depth' => $depth));
}
return "Error in menu source ".$source. ".";
}
/* menus */
function art_get_list_menu($args = array()) {
global $art_config;
$menu = $args['menu'];
$menu_items = wp_get_nav_menu_items($menu->term_id);
if(empty($menu_items)) {
return sprintf(
'<li><a>'
.$art_config['menu']['topItemBegin']
.__("Empty menu (%s)")
.$art_config['menu']['topItemEnd']
.'</a></li>', $menu->slug);
}
$nav_menu = '';
$items = '';
_art_menu_item_classes_by_context($menu_items);
$sorted_menu_items = array();
foreach ((array) $menu_items as $key => $menu_item) $sorted_menu_items[$menu_item->menu_order] = wp_setup_nav_menu_item($menu_item);
$walker = new art_MenuWalker();
$items .= $walker->walk($sorted_menu_items, 0, array());
$items = apply_filters('wp_nav_menu_items', $items, $args);
$items = apply_filters("wp_nav_menu_{$menu->slug}_items", $items, $args);
$nav_menu .= $items;
$nav_menu = apply_filters('wp_nav_menu', $nav_menu, $args);
return $nav_menu;
}
function _art_menu_item_classes_by_context( &$menu_items ) {
global $wp_query;
$queried_object = $wp_query->get_queried_object();
$queried_object_id = (int) $wp_query->queried_object_id;
$active_ID = null;
$IdToKey = array();
foreach ( (array) $menu_items as $key => $menu_item ) {
$IdToKey[$menu_item->ID] = $key;
if (
$menu_item->object_id == $queried_object_id &&
(
( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id ) ||
( 'post_type' == $menu_item->type && $wp_query->is_singular ) ||
( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )
)
) {
$active_ID = $menu_item->ID;
} elseif ( 'custom' == $menu_item->object ) {
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
if ( $item_url == $current_url ) {
$active_ID = $menu_item->ID;
}
}
}
$currentID = $active_ID;
while ($currentID !== null && isset($IdToKey[$currentID])) {
$current_item = $menu_items[$IdToKey[$currentID]];
$current_item->classes[] = 'active';
$currentID = $current_item->menu_item_parent;
if ($currentID === '0') break;
}
}
class art_MenuWalker extends Walker {
var $tree_type = array('post_type', 'taxonomy', 'custom');
var $db_fields = array('parent' => 'menu_item_parent', 'id' => 'db_id');
var $is_active = false;
function start_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul";
if ($this->is_active){
$output .= ' class="active" ';
}
$output .= ">\n";
$this->is_active = false;
}
function end_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
global $art_config;
$indent = ($depth) ? str_repeat("\t", $depth) : '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$active = in_array('active', $classes);
$output .= $indent . '<li';
if ($active) {
$this->is_active = true;
$output .= ' class="active" ';
}
$output .= '>';
$attributes = ! empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) .'"' : '';
$attributes .= ! empty($item->target) ? ' target="' . esc_attr($item->target) .'"' : '';
$attributes .= ! empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) .'"' : '';
$attributes .= ! empty($item->url) ? ' href="' . esc_attr($item->url) .'"' : '';
$attributes .= ! empty($class_names) ? ' class="' . esc_attr($class_names) .'"' : '';
$item_output .= '<a'. $attributes .'>';
if ($depth == 0) $item_output .= $art_config['menu']['topItemBegin'];
$item_output .= apply_filters('the_title', $item->title, $item->ID);
if ($depth == 0) $item_output .= $art_config['menu']['topItemEnd'];
$item_output .= '</a>';
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
function end_el(&$output, $item, $depth) {
$output .= "</li>\n";
$this->is_active = false;
}
}
/* pages */
function art_get_list_pages($args = array()) {
global $wp_query;
global $art_config;
$pages = &get_pages();
$IdToKey = array();
$currentID = null;
foreach ($pages as $key => $page)
{
$IdToKey[$page->ID] = $key;
}
if ($wp_query->is_page) {
$currentID = $wp_query->get_queried_object_id();
}
$frontID = null;
$blogID = null;
if ('page' == get_option('show_on_front')) {
$frontID = get_option('page_on_front');
if ($frontID && isset($IdToKey[$frontID])) {
$frontKey = $IdToKey[$frontID];
$frontPage = $pages[$frontKey];
unset($pages[$frontKey]);
$frontPage->post_parent = '0';
$frontPage->menu_order = '0';
array_unshift($pages, $frontPage);
$IdToKey = array();
foreach ($pages as $key => $page)
{
$IdToKey[$page->ID] = $key;
}
}
if (is_home()) {
$blogID = get_option('page_for_posts');
if ($blogID && isset($IdToKey[$blogID]))
{
$currentID = $blogID;
}
}
}
$activeIDs = array();
$activeID = $currentID;
while($activeID && isset($IdToKey[$activeID]))
{
$activeIDs[] = $activeID;
$activePage = $pages[$IdToKey[$activeID]];
if ($activePage && $activePage->post_status == 'private')
{
break;
}
$activeID = $activePage->post_parent;
}
$result = '';
if ($art_config['menu']['showHome'] && ('page' != get_option('show_on_front') || (!get_option('page_on_front') && !get_option('page_for_posts'))))
{
$result = '<li><a'
. (is_home() ? ' class="active"' : '')
. ' href="'
. get_option('home')
. '">'
.$art_config['menu']['topItemBegin']
. $art_config['menu']['homeCaption']
.$art_config['menu']['topItemEnd']
. '</a></li>';
}
if (!empty($pages)) {
$walker = new art_PageWalker('list', 'ul', $activeIDs, $frontID);
$result .= $walker->walk($pages,$args['depth'], array(), $currentID);
}
return $result;
}
class art_PageWalker extends Walker {
var $db_fields = array('parent' => 'post_parent', 'id' => 'ID');
var $activeIDs = array();
var $frontID = array();
var $is_active = false;
function art_PageWalker($type='list', $tag='ul', $activeIDs=array(), $frontID=null){
$this->tag = $tag;
$this->activeIDs = $activeIDs;
$this->frontID = $frontID;
$this->type = $type;
}
function start_lvl(&$output) {
$output .= "\n<".$this->tag;
if($this->is_active){
$output .= ' class="active" ';
}
$output .= ">\n";
$this->is_active = false;
}
function end_lvl(&$output) {
$output .= "</".$this->tag.">\n";
}
function start_el(&$output, $page, $depth, $args, $current_page) {
global $art_config;
$active = in_array($page->ID, $this->activeIDs);
$output .= '<li';
if ($active) {
$this->is_active = true;
$output .= ' class="active" ';
}
$output .= '><a';
if ($active) {
$output .= ' class="active"';
}
$href = get_page_link($page->ID);
if ($this->frontID && $this->frontID == $page->ID) {
$href = get_option('home');
}
$output .= ' href="'.$href.'" title="'.$page->post_title.'">';
if ($depth == 0) $output .= $art_config['menu']['topItemBegin'];
$output .= apply_filters('the_title', $page->post_title);
if ($depth == 0) $output .= $art_config['menu']['topItemEnd'];
$output .= '</a>';
}
function end_el(&$output, $page) {
$output .= "</li>\n";
$this->is_active = false;
}
}
(Habe hier was m.E. unrelevantes rausgelöscht weil es zu viel Text für ein Post war.)
Alles anzeigen
Probleme gelöst!
Erstmal die Eckdaten:
Version: WP 3.2.1
Theme: Flashglobeblue 1.0
URL: DJ-Blog.com
Ich vermute mal, dass meine gewünschten Einstellungen nicht in Wordpress sondern im Theme direkt geändert werden müssen.
1. Problem: Anordnung/Reihenfolge der TOP Navigation.
Screenshot: http://img849.imageshack.us/img849/2436/screen1zd.png
Die Reihenfolge der linke Navigation habe ich durch "Page Attributes/Seiteneinstellungen" auf der jeweiligen Seite eingestellt. Nach dieser Anordnung soll auch die TOP Navigation geordnet werden.
Ich habe leider nicht gefunden wo im Theme sourcecode ich dies einstellen kann. Vielleicht findet ja jemand mit mehr PHP-Erfahrung die relevanten stellen ;)
2. Problem: Kürzung von Beiträgen
Beiträge werden automatisch gekürzt wie in folgendem Screenshot zu sehen ist.
Screenshot: http://img191.imageshack.us/img191/6744/screen2aq.png
Die gesamten Artikel inkl. "Soundcloud-Tag"/"Youtube-Tag" sollen wie bei der "Einzelansicht" angezeigt werden: http://img263.imageshack.us/img263/3064/screen2br.png
Vielen Dank für euere Hilfe!
Theme Quellcodes:
wp-content\themes\flashglobeblue\config.ini
[theme]
name = "Flashglobeblue";
shortname = "DWT";
build = "2.5.0.29918";
[menu]
homeCaption = "Home";
showHome = true;
topItemBegin = "<span class='l'></span><span class='r'></span><span class='t'>";
topItemEnd = "</span>";
showSubitems = true;
source = "Pages";
[vmenu]
showSubitems = false;
source = "Categories";
[metadata]
thumbnail_auto = false;
thumbnail_width = 100;
thumbnail_height = 100;
excerpt_auto = false;
excerpt_min_remainder = 5;
excerpt_words = 40;
excerpt_allowed_tags = "a,img,abbr,blockquote,b,cite,pre,code,em,label,i,p,span,strong,ul,ol,li,"
title = false;
separator = " | ";
header = "date,author,edit";
footer = "category,tag,comments";
date = "<img class='art-metadata-icon' src='[template_url]/images/postdateicon.png' width='18' height='18' alt='' />";
author = "";
category = "<img class='art-metadata-icon' src='[template_url]/images/postcategoryicon.png' width='18' height='18' alt='' />";
tag = "<img class='art-metadata-icon' src='[template_url]/images/posttagicon.png' width='18' height='18' alt='' />";
comments = "<img class='art-metadata-icon' src='[template_url]/images/postcommentsicon.png' width='18' height='18' alt='' />";
edit = "<img class='art-metadata-icon' src='[template_url]/images/postediticon.png' width='20' height='20' alt='' />";
[sidebars]
default = "categories,blogroll";
secondary = "search,archive";
top = "";
bottom = "";
footer = "";
[footer]
defaultText = "";
rss_link = "<a href='[rss_url]' class='art-rss-tag-icon' title='[rss_title]'></a>"
rss_show = true;
Alles anzeigen
wp-content\themes\flashglobeblue\header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="DC.creator" content="dwt" />
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<title><?php echo art_get_page_title() ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" /><![endif]-->
<?php if(WP_VERSION < 3.0): ?>
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick')); ?>" href="<?php bloginfo('atom_url'); ?>" />
<?php endif; ?>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if (is_file(TEMPLATEPATH .'/favicon.ico')):?>
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
<?php endif; ?>
<?php wp_head(); ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
</head>
<body>
<?php
ob_start();
Alles anzeigen