In dem WP-Buch habe ich gelesen, was ich in die functions.php eintragen muss, um Vorlagen für neue Seiten bestimmen zu können.
Jedoch: die vorher bestehende functions.php ist lang und unübersichtlich, und ich habe keine Ahnung, wo ich das eintragen soll. Prompt klappt es nicht, und es wird der folgende Fehler gesendet:
Parse error: syntax error, unexpected ''add_new'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /www/htdocs/w00ed1bd/sandbox/wp-content/themes/outspoken/functions.php on line 46
Sprich die Seite geht damit kaputt.
Im Original stand: add_action('admin_menu', 'remove_admin_menu_items' );
Ich habe daraus gemacht: add_action('admin_menu', 'remove_admin_menu_items', 'init', 'add_cpt_firmenbeschreibung' );
Ist das falsch? Der Fehler wird aber auch an einer anderen Stelle angemarkert, nämlich in
'add_new' => _x('Hinzufügen', 'Firma'),
Vielleicht hat jemand die Zeit, sich das unten einmal anzusehen und mir zu sagen, wo der Fehler liegt - bzw. wo ich den Code eintragen muss. Da die Original-Datei 3400 Zeilen lang ist, nehme ich nur den Auszug und hoffe, das reicht. (Wenn ich es über 'Datei einfügen' versuche, wird der Anfang abgeschnitten...?)
Mit herzlichem Dank im Voraus - P.
/**
* Outspoken functions and definitions.
*
* Sets up the theme and provides some helper functions, which are used in the
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development
* and http://codex.wordpress.org/Child_Themes), you can override certain
* functions (those wrapped in a function_exists() call) by defining them first
* in your child theme's functions.php file. The child theme's functions.php
* file is included before the parent theme's file, so the child theme
* functions would be used.
*
* Functions that are not pluggable (not wrapped in function_exists()) are
* instead attached to a filter or action hook.
*
* For more information on hooks, actions, and filters,
* see http://codex.wordpress.org/Plugin_API
*/
/**
* Sets up the content width value based on the theme's design.
*/
/* Clean up the admin sidebar navigation *************************************************/
function remove_admin_menu_items() {
$remove_menu_items = array(__('Users'), __('Meta'));
global $menu;
end ($menu);
while (prev($menu)){
$item = explode(' ',$menu[key($menu)][0]);
if(in_array($item[0] != NULL?$item[0]:"" , $remove_menu_items)){
unset($menu[key($menu)]);
}
}
}
add_action('admin_menu', 'remove_admin_menu_items', 'init', 'add_cpt_firmenbeschreibung' );
/*mit 'init' fängt der Pfusch an - muss man in eine eigene add_action-Funktion pcaken?*/
function add_cpt_firmenbeschreibung() {
$labels = array(
'name' => _x('firmenbeschreibung', 'post type general name'),
'singular_name' => _x('Firma',
'post type singular name')
'add_new' => _x('Hinzufügen', 'Firma'),
'add_new_item' => _('Neue Firma hinzufügen'),
'edit_item' => _('Firma bearbeiten'),
'new_item' => _('Neue Firma'),
'view_item' => _('Firma ansehen'),
'search_items' => _('Firma suchen'),
'not_found' => _('Keine Firma gefunden'),
'not_found_in_trash' => _('Keine Firma im Papierkorb gefunden'),
'parent_item_colon' => ''
);
$support = array( 'title',
'editor',
'thumbanil'
'excerpt');
$args = array(
'labels' => $labels,
'public' => true,
'publicity_queryable' => true,
'show_ui' => true,
'_builtin' => false,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array("slug" => "firmenbeschreibung"),
'capability_type' => 'post',
'hierarchical' => false,
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 20,
'supports' => $supports
);
register_post_type('firmenbeschreibung',$args);
}
/*bis hierher herumgepfuscht*/
if (!isset($content_width))
$content_width = wpShower::getContentWidth();
add_filter('widget_text', 'do_shortcode');
/**
* Adds support for a custom background
*/
add_theme_support('custom-background', array('default-color' => 'f4f3f0'));
/**
* Outspoken only works in WordPress 3.6 or later.
Alles anzeigen