ste3et_C0st
Neues Mitglied
Hallo ich habe ein problem und zwar folgendes ich probiere für mein Wordpress Theme Optionen einzubauen.
Ich möchte das man durch eine textarea ihm footer einen ihn halt eines div Containers beschreibt ausschließlich mit html und css. Das geht auch allerdings ändert er folgenden text.
zu
Hier mal meine functions datei.
Ich versteh nicht was ich falsch mache also er hängt hinter jedes \ noch ein \ das ist etwas dumm :-?
Ich möchte das man durch eine textarea ihm footer einen ihn halt eines div Containers beschreibt ausschließlich mit html und css. Das geht auch allerdings ändert er folgenden text.
Code:
<a>Du willst für unseren Server spenden dan drück auf den Spenden Button</a>
<a href='http://dicecraft.de/?page_id=20'> ||HILFE||</a></br>
<a href='http://server.nitrado.net/donations/donate/24674'>
<img src='<?php bloginfo('template_url'); ?>/images/donate.png'/></a>
zu
Code:
<a>Du willst für unseren Server spenden dan drück auf den Spenden Button</a>
<a href=\'http://dicecraft.de/?page_id=20\'> ||HILFE||</a></br>
<a href=\'http://server.nitrado.net/donations/donate/24674\'>
<img src=\'<?php bloginfo(\'template_url\'); ?>/images/donate.png\'/></a>
Hier mal meine functions datei.
Code:
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
add_theme_support('post-thumbnails');
if ( function_exists('add_theme_support') ) {
add_theme_support('post-thumbnails');
}
add_custom_background();
?>
<?php
function new_excerpt_more($more) {
global $post;
return '... <a href="'. get_permalink($post->ID) . '"> Read more » </a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
function new_excerpt_length($length) {
return 80;
}
add_filter('excerpt_length', 'new_excerpt_length');
?>
<?php
wp_enqueue_script('autosave');
$themename = "Dicecraft";
$shortname = "tme";
$options = array (
array( "name" => $themename." Einstellungen",
"type" => "title"),
array( "type" => "open"),
array("name" => "Default background image",
"desc" => "Hintergrund Bild Url",
"id" => $shortname."_default",
"std" => get_bloginfo('template_directory')."/images/background.png",
"type" => "text"),
array("type" => "break"),
array( "name" => "Logo URL",
"desc" => "Gib hier einen link für dein Logo ein",
"id" => $shortname."_logo",
"type" => "text",
"std" => ""),
array("type" => "break"),
array( "name" => "Google Analytics Code",
"desc" => "Gib hier deinen Google Analytics code ein.",
"id" => $shortname."_ga_code",
"type" => "textarea",
"std" => ""),
array("type" => "break"),
array( "name" => "Twitter ID",
"desc" => "Dein Twitter Name",
"id" => $shortname."_twitterid",
"type" => "text",
"std" => ""),
array("type" => "break"),
array( "name" => "Youtube ID",
"desc" => "Dein Youtube Name",
"id" => $shortname."_youtube",
"type" => "text",
"std" => ""),
array("type" => "break"),
array( "name" => "468x60 banner hinzufügen",
"desc" => "Gib hier einen link für einen banner ein.",
"id" => $shortname."_adcode",
"type" => "textarea",
"std" => ""),
array("type" => "break"),
array( "name" => "Footer Box 1",
"desc" => "Hier Kannst du den ersten footer editieren. HTML/CSS",
"id" => $shortname."_footerbox",
"type" => "textarea",
"std" => ""),
array("type" => "break"),
array( "name" => "Footer Box 2",
"desc" => "Hier Kannst du den zweiten footer editieren. HTML/CSS",
"id" => $shortname."_footerbox2",
"type" => "textarea",
"std" => ""),
array("type" => "break"),
array( "name" => "Footer Box 3",
"desc" => "Hier Kannst du den dritten footer editieren. HTML/CSS",
"id" => $shortname."_footerbox3",
"type" => "textarea",
"std" => ""),
array( "type" => "close"));
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_menu_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_add_init() {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
?>
<div class="wrap">
<h2><?php echo $themename; ?> Einstellungen</h2>
<form method="post">
<?php foreach ($options as $value) {
switch ( $value['type'] ) {
case "open":
?>
<table width="100%" border="0" style="background-color:#FFF; padding:10px;">
<?php break;
case "close":
?>
</table><br />
<?php break;
case "title":
?>
<table width="100%" border="0" style="background-color:#FFF; padding:5px 10px;"><tr>
<td colspan="2"><h3 style="font-family:Helvetica, arial, sans-serif;"><?php echo $value['name']; ?></h3></td>
</tr>
<?php break;
case 'text':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><input style="width:400px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px solid #ccc;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case 'textarea':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><textarea name="<?php echo $value['id']; ?>" style="width:400px; height:200px;" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?></textarea></td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px solid #ccc;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case 'select':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select></td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px solid #ccc;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case "checkbox":
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
</td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px solid #ccc;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php break;
}
}
?>
<div>
<h1>Info</h1>
<p>Erstelle eine neue Katigorie mit dem namen Featured.</p>
<p>Erstelle einen Artikel ihn dieser Katigorie und Füge ein bild ein mit den massen 920 x 300 es muss ein .jpg datei sein</p>
<p>Bei der Erstellung des Artikels muss berücksichtigt werden das die Benutzerdefinieerten Felder Aktiv sind.</p>
<p>- Sollten sie nicht sichtbar sein geh aud Optionen einblenden und aktivier diese.</p>
<p>Jetzt erstellst du ein neues Feld mit dem namen nivoimage und der wert ist der link des bildes.</p>
</div>
<p class="submit">
<input name="save" type="submit" value="Speichern" />
<input type="hidden" name="action" value="save" />
</p>
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Zurücksetzten" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
</div>
<?php
}add_action('admin_menu', 'mytheme_add_admin');
add_action('admin_init', 'mytheme_add_init');
?>
Ich versteh nicht was ich falsch mache also er hängt hinter jedes \ noch ein \ das ist etwas dumm :-?