par
dohkoj » 16 déc. 2014, 06:21
Bonjour a tous
Tres debutant en php, j'ai une erreur de syntaxe que je ne comprends pas sur un de mes fichiers.
Voici l'erreur quand je me connecte a mon site (
http://www.leterroir-winebar.fr):
Parse error: syntax error, unexpected '<' in D:\Hosting\11415647\html\index.php on line 19
Et voici le code php du fichier index.php:
<?php get_header(); ?>
<?php
$post_type = get_post_type();
if ( $post_type && $post_type != 'post' ) {
$post_type_label = get_post_type_object( $post_type )->label;
if ( ! $post_type_label ) {
$post_type_label = $post_type;
}
} else {
$post_type_label = 'News';
}
?>
<!-- inner -->
<div id="hpb-inner">
<!-- content -->
<div id="hpb-content">
<!-- title -->
<div id="hpb-title">
<?php if ( $post_type && $post_type != 'post' ) : ?>
<h2><a href="<?php echo get_post_type_archive_link( $post_type ); ?>" id="hpb-page-title"><?php echo $post_type_label; ?></a></h2>
<?php else : ?>
<h2><a id="hpb-page-title"><?php echo $post_type_label; ?></a></h2>
<?php endif; ?>
</div>
<!-- main -->
<div id="hpb-main">
<div id="bloglist">
<div class="hpb-viewtype-full hpb-posttype-<?php echo $post_type; ?>">
<?php if ( have_posts() ) : ?>
<?php while( have_posts() ) : the_post(); ?>
<article>
<header class="hpb-entry-header">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
</header>
<?php if ( has_post_thumbnail() ) : ?>
<p class="hpb-entry-thumb"><?php the_post_thumbnail(); ?></p>
<?php endif; ?>
<div class="hpb-entry-content"><?php the_content(); ?></div>
<footer class="hpb-entry-footer">
<p class="hpb-postinfo">
<?php if ( $post_type && $post_type != 'post' ) : ?>
カテゴリー:
<?php foreach ( get_object_taxonomies( $post_type ) as $tax_name ) {
echo get_the_term_list( $post->ID, $tax_name, '', ', ' );
} ?>
<?php else: ?>
カテゴリー:<?php the_category( ', ' ); ?>
|タグ:<?php the_tags( '', ', ' ); ?><br />
作成者:<?php the_author(); ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
|<a href="<?php comments_link(); ?>">コメント<?php comments_number( 'はありません', ': 1件', ': %件' ); ?></a>
<?php endif; ?>
|<?php echo get_the_date(); ?>
</p>
</footer>
</article>
<?php endwhile; ?>
<nav class="hpb-pagenation">
<span class="hpb-oldpage"><?php next_posts_link( '« 古い記事' ); ?></span>
<span class="hpb-newpage"><?php previous_posts_link( '新しい記事 » ' ); ?></span>
</nav>
<?php endif; ?>
</div>
</div>
</div>
<!-- main end -->
</div>
<!-- content end -->
<?php get_sidebar(); ?>
</div>
<!-- inner end -->
<?php get_footer(); ?>
En esperant que vous puissiez m'aider rapidement.
Merci
Bonjour a tous
Tres debutant en php, j'ai une erreur de syntaxe que je ne comprends pas sur un de mes fichiers.
Voici l'erreur quand je me connecte a mon site (http://www.leterroir-winebar.fr):
Parse error: syntax error, unexpected '<' in D:\Hosting\11415647\html\index.php on line 19
Et voici le code php du fichier index.php:
[php]<?php get_header(); ?>
<?php
$post_type = get_post_type();
if ( $post_type && $post_type != 'post' ) {
$post_type_label = get_post_type_object( $post_type )->label;
if ( ! $post_type_label ) {
$post_type_label = $post_type;
}
} else {
$post_type_label = 'News';
}
?>
<!-- inner -->
<div id="hpb-inner">
<!-- content -->
<div id="hpb-content">
<!-- title -->
<div id="hpb-title">
<?php if ( $post_type && $post_type != 'post' ) : ?>
<h2><a href="<?php echo get_post_type_archive_link( $post_type ); ?>" id="hpb-page-title"><?php echo $post_type_label; ?></a></h2>
<?php else : ?>
<h2><a id="hpb-page-title"><?php echo $post_type_label; ?></a></h2>
<?php endif; ?>
</div>
<!-- main -->
<div id="hpb-main">
<div id="bloglist">
<div class="hpb-viewtype-full hpb-posttype-<?php echo $post_type; ?>">
<?php if ( have_posts() ) : ?>
<?php while( have_posts() ) : the_post(); ?>
<article>
<header class="hpb-entry-header">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
</header>
<?php if ( has_post_thumbnail() ) : ?>
<p class="hpb-entry-thumb"><?php the_post_thumbnail(); ?></p>
<?php endif; ?>
<div class="hpb-entry-content"><?php the_content(); ?></div>
<footer class="hpb-entry-footer">
<p class="hpb-postinfo">
<?php if ( $post_type && $post_type != 'post' ) : ?>
カテゴリー:
<?php foreach ( get_object_taxonomies( $post_type ) as $tax_name ) {
echo get_the_term_list( $post->ID, $tax_name, '', ', ' );
} ?>
<?php else: ?>
カテゴリー:<?php the_category( ', ' ); ?>
|タグ:<?php the_tags( '', ', ' ); ?><br />
作成者:<?php the_author(); ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
|<a href="<?php comments_link(); ?>">コメント<?php comments_number( 'はありません', ': 1件', ': %件' ); ?></a>
<?php endif; ?>
|<?php echo get_the_date(); ?>
</p>
</footer>
</article>
<?php endwhile; ?>
<nav class="hpb-pagenation">
<span class="hpb-oldpage"><?php next_posts_link( '« 古い記事' ); ?></span>
<span class="hpb-newpage"><?php previous_posts_link( '新しい記事 » ' ); ?></span>
</nav>
<?php endif; ?>
</div>
</div>
</div>
<!-- main end -->
</div>
<!-- content end -->
<?php get_sidebar(); ?>
</div>
<!-- inner end -->
<?php get_footer(); ?>[/php]
En esperant que vous puissiez m'aider rapidement.
Merci