以下のコードを、function.phpに記載をしましたが、エラーが出ているようです。
自作ウィジェットは、初めてなのでわかりません。
<?php class option1 extends WP_Widget { function __construct() { parent::__construct( 'option1', // ウィジェットのベースID 'option1', // ウィジェットの名前 array( 'description' => 'Display Specific HTML File' ) // ウィジェットの説明 ); } /* 管理画面の設定とか表示用コードを書く */ function form($instance) { } /* 管理画面で設定を変更した時の処理を書く */ function update($new_instance, $old_instance) { } /* ウィジェットを配置した時の表示用コードを書く */ function widget($args, $instance) { ?> <style type="text/css"> <!-- .button { position: relative; background-color: #87CEFA; border-radius: 4px; color: #fff; line-width: 104px; line-height: 104px; -webkit-transition: none; transition: none; box-shadow: 0 3px 0 #0e8c73; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); } .button:active { top: 3px; box-shadow: none; } .block { padding: 50px; background: #fff; border: 1px #ccc solid; box-shadow: 0 2px 3px 0 #ddd; -moz-box-shadow: 0 2px 3px 0 #ddd; -webkit-box-shadow: 0 2px 3px 0 #ddd; } .block2 { padding: 50px; background: #00FA9A; border: 1px #ccc solid; box-shadow: 0 2px 3px 0 #ddd; -moz-box-shadow: 0 2px 3px 0 #ddd; -webkit-box-shadow: 0 2px 3px 0 #ddd; } .side-corner-tag { position: relative; color: #ffffff; padding: 5px; overflow: hidden; font-family: Arial, sans-serif; font-weight: 900; } .side-corner-tag p { display: inline; } .side-corner-tag p span { position: absolute; display: inline-block; right: -25px; box-shadow: 0px 0px 10px rgba(0,0,0,0.2), inset 0px 5px 30px rgba(255,255,255,0.2); text-align: center; text-transform: uppercase; top: 22px; background: #d93131; width: 100px; padding: 3px 10px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -o-transform: rotate(45deg); -ms-transform: rotate(45deg); } .side-corner-tag p:before { content: ""; width: 0; height: 0; position: absolute; top: -17px; right: 69px; z-index: +1; border: 17px solid; border-color: transparent transparent #662121 transparent; } .side-corner-tag p:after { content: ""; width: 0; height: 0; position: absolute; top: 74px; z-index: +1; right: -10px; border: 17px solid; border-color: #662121 transparent transparent transparent; } --> </style> <?php extract(shortcode_atts(array( "ex" => '', "type" => 'project' ), $atts)); global $post; $myposts = get_posts('numberposts=-1&order=ASC&post_type='.$type.'&exclude='.$ex); $retour='<form method="get" action="'.home_url('/').'"> <input type="text" name="s" value="'.the_search_query().'" placeholder="検索" /> <input type="hidden" name="post_type" value="project"> <input type="submit" value="検索" /> </form><ul>'; foreach($myposts as $post) : if(!is_subpage()) { setup_postdata($post); if(has_tag('あまり')){ $retour.='<div class="side-corner-tag"><a href="'.get_permalink().'">'.get_the_post_thumbnail( $page->ID, 'thumbnail' ).the_title("","",false).get_the_content("学び " . get_the_title()).'</a><p><span>新作</span></p></div> '; } else{ $retour.='<div class="block"><a href="'.get_permalink().'">'.get_the_post_thumbnail( $page->ID, 'thumbnail' ).the_title("","",false).get_the_content("Continue reading " . get_the_title()).'</a></div> '; } } endforeach;wp_reset_postdata(); return $retour; } } /* 自作ウィジェットを使えるようにする処理 */ register_widget('option1'); ?>
すいませんが、ご教授お願いします。
エラー内容
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /home/users/1//web/wordpress/wp-includes/functions.php on line 3897
Notice: bp_setup_current_user was called incorrectly. 現在のユーザーは $wp->init() を使用せずに初期化されています。 Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/users/1//web/wordpress/wp-includes/functions.php on line 3897
Parse error: syntax error, unexpected ' function' (T_STRING), expecting function (T_FUNCTION) in /home/users/1//web/wordpress/wp-content/themes/athena/functions.php on line 159