Wordpress index.php giving error with sidebar

Asked

Viewed 14 times

0

I’m making a template from scratch with the basic knowledge I have in html and css, but I’m having some against times like this: https://overlove.000webhostapp. com/blog

I’ve gone over everything and every way and I can’t find the error in any way. The functions.php file is normal and Index.php is also... If anyone can answer me, I’d appreciate it.

index php.

<div class="container">
<?php if(have_posts()): ?>
<?php  while(have_posts()):the_post(); ?>

       <div class="sidebar"> 
            <?php dynamic_sidebar('sidebar01') ?>
       </div>
    <div class="content">
        <h2>
            <a href="<?php the_permalink(); ?>" id="title" ><?php the_title(); ?></a>
        </h2>

        <div class="thumbnail">
            <?php the_post_thumbnail(array('911, 120')); ?>
        </div>
        <br/><br/><br/><br/><br/><br/>
        <div class="description"><?php the_excerpt(); ?></div><br/>

        <div class="readmore">
            <a href="<?php the_permalink(); ?>" >Continuar Lendo</a>
        </div>
        <div class="author_public">
            <publiclado>Publicado</publiclado> em <?php the_date("j/m/Y"); ?> <publiclado>Por:</publiclado> <?php the_author(); ?>
        </div>
    </div>
    <br/>
<?php
    endwhile;
    else:
?>
<div class="no-post" >Nenhum post encontrado!</div>
<?php
    endif;
?>

<?php get_footer(); ?>

Functions.php

<?php
    register_sidebar(array(
        'name'=>'sidebar01',
        'id' => 'sidebar-1',
        'before_widget' => '<li class="widget">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widgettitle">',
        'after_title' => '</h4>',
    ));

    register_sidebar(array(
        'name'=>'sidebaranimes',
        'id' => 'sidebar-2',
        'before_widget' => '<li class="widget">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widgettitle">',
        'after_title' => '</h4>',
    ));

    register_sidebar(array(
        'name'=>'sidebaranimes2',
        'id' => 'sidebar-3',
        'before_widget' => '<li class="widget">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widgettitle">',
        'after_title' => '</h4>',
    ));

    add_theme_support( 'post-thumbnails', array( 'post' ) ); 
    set_post_thumbnail_size( 911, 120, true );

?>

1 answer

0

Where is:

    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h4>',

Should be:

    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>'

That is, you are closing the wrong title tag and are including a comma in the last element when you should not have.

  • 1

    Yes, now I realize... Lack of attention. But in comma relation, the wordpress tutorial has.. https://Codex.wordpress. org/Function_reference/register_sidebar But anyway, with or without comma and agr I closed the right title, it hasn’t changed at all. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.