function.phpを編集したら、レイアウト崩れしました。以下、追加部分のみ
PHP
1function shortcode_project($atts, $content = null) { 2 extract(shortcode_atts(array( 3 "ex" => '', 4 "type" => 'project' 5 ), $atts)); 6 global $post; 7 $myposts = get_posts('numberposts=-1&order=ASC&post_type='.$type.'&exclude='.$ex); 8 $retour='<form method="get" action="'.home_url('/').'"> 9 10 <input type="text" name="s" value="'.the_search_query().'" placeholder="??" /> 11 <input type="hidden" name="post_type" value="project"> 12 <input type="submit" value="??" /> 13 </form><ul>'; 14 15 foreach($myposts as $post) : 16 if(!is_subpage()) { 17 setup_postdata($post); 18 if(has_tag('1')){ 19 20 $retour.='<div class="side-corner-tag"><div class="block2"><a href="'.get_permalink().'">'.get_the_post_thumbnail( $page->ID, 'thumbnail' ).the_title("","",false).get_the_content("Continue reading " . get_the_title()).'<a class="button" href="'.get_permalink().'"></a></div></a></div><p><span></span></p></div> '; 21 22} 23 24else{ 25 $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> '; 26 27} 28 29} 30 endforeach;wp_reset_postdata(); 31 return $retour; 32} 33 34add_action( 'wp_enqueue_scripts', 'business_one_page_scripts' ); 35 36/** 37 * Custom template tags for this theme. 38 */ 39require get_template_directory() . '/inc/template-tags.php'; 40 41/** 42 * Custom functions that act independently of the theme templates. 43 */ 44require get_template_directory() . '/inc/extras.php'; 45 46/** 47 * Customizer additions. 48 */ 49require get_template_directory() . '/inc/customizer.php'; 50 51/** 52 * Load Jetpack compatibility file. 53 */ 54require get_template_directory() . '/inc/jetpack.php'; 55 56/** 57 * Post Meta Box 58 */ 59require get_template_directory() . '/inc/metabox.php'; 60 61/** 62 * Widget Recent Post 63 */ 64require get_template_directory() . '/inc/widget-recent-post.php'; 65 66/** 67 * Widget Popular Post 68 */ 69require get_template_directory() . '/inc/widget-popular-post.php'; 70 71/** 72 * Widget Social Links 73 */ 74require get_template_directory() . '/inc/widget-social-links.php'; 75 76/** 77 * Multiple Image Field 78 * 79 * @link https://github.com/lucatume/wp-customizer 80 */ 81require get_template_directory() . '/inc/multiimage-custom-control.php'; 82 add_shortcode('project', 'shortcode_project'); 83 84get_template_part('create-project'); 85get_template_part('create-proposal');
ちなみに、関数部分を echo 'aaa';のみにすると正常に動作しました