내 블로그의 최신 게시물을 표시하는 짧은 코드로 호출하는 쿼리를 작성하려고하지만 일부 구문 오류가 발생합니다.짧은 코드로 최신 게시물을 표시하는 쿼리
코드 : I 쿼리 작업을 일단
function newest_post_query() {
$the_query = new WP_Query('posts_per_page=1');
while ($the_query -> have_posts()) : $the_query -> the_post();
echo '<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>';
wp_reset_postdata();
}
add_shortcode('newest_post', 'newest_post_query');
I 출력 마크 업을 편집 할 수 있습니다. 어떤 도움이라도 정말 감사 할 것입니다!
구문 오류 란 무엇입니까? – zanderwar
'Parse error : 예기치 않은 구문 오류 '}'/home/ourcore/public_html/wp-content/themes/portfolio/functions.php on line 108' (스 니펫의 5 번째 줄). 그 외에도 쿼리가 작동하는지 확실하지 않습니다. –
그 오류는 쿼리와 관련이 없습니다. functions.php의 줄은 무엇입니까? – zanderwar