Mais conteúdo relacionado
Mais de Yuriko IKEDA (20)
WordpressとPHPの素敵な関係
- 39. <?php if ( have_posts() ) : ?>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part('content',get_post_format());?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php endif; ?>
- 42. function the_content($more_link_text=null,$stripteaser=0, $more_file='') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}
function strip_del($content) {
$content = preg_replace('#<del[^>]*>.*?</del>s*#s',
'', $content);
return $content;
}
add_filter('the_content', 'strip_del');
- 46. WP_Widget
class My_Widget extends WP_Widget {
function My_Widget() {
parent::WP_Widget( 'My_widget', $name = 'My_Widget' );
}
function form($instance) {
//
}
function update($new_instance, $old_instance) {
//
}
function widget($args, $instance) {
//
}
}
register_widget('My_Widget');
- 47. namespace abc;
class mywidgetclass extends WP_Widget {
function __construct() {
parent::__construct('name1', 'name2');
}
// ... rest of functions
}
add_action('widgets_init',function() {
return register_widget('abcmywidgetclass');
});
Notas do Editor
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n