teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

終了しました。

2020/05/15 00:04

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,103 +1,1 @@
1
- 現在、自作テンプレートを作成ていす。
1
+ ☆☆☆回答なしとのこと終了しました☆☆☆
2
-
3
- sidebar.phpを作成するとウィジェットが消えてますので表示でできるようにしたいのです。
4
-
5
- さらにfooterの位置もおかしくすべて右側によってしまっています。
6
-
7
- これらをちゃんと表示するにはどのようにすればよいのでしょうか?
8
-
9
- ざっくりした質問で申し訳けありません。
10
- ### sidebar.phpがある状態
11
- ![イメージ説明](d5ebb7f95127323c1cf216561a6e270d.png)
12
-
13
- ### sidebar.phpがない状態
14
- ![イメージ説明](934aefc1db436e3eaea5517116e4fc2c.png)
15
-
16
- ### ソース
17
-
18
- index.php
19
- ```
20
-
21
- <?php get_header(); ?>
22
-
23
- <!-- コンテンツ -->
24
- <main>
25
-
26
- <?php if(have_posts()): while(have_posts()):the_post(); ?>
27
-
28
- <div class="post">
29
- <div class="rose_dy"><img src="<?php echo get_stylesheet_directory_uri(); ?>/img/rose_dy.png" /></img><p><time datetime="<?php the_time('m-d'); ?>"><?php the_time('m/d'); ?></time></p></div>
30
- <p class="title"><?php echo mb_substr($post->post_title, 0, 32); ?></p>
31
- <?php the_post_thumbnail(array(640, 480)); ?>
32
-
33
- <p><a href="<?php the_permalink(); ?>">Read More</a></p></div>
34
- <?php endwhile; endif; ?>
35
- </main>
36
-
37
- <?php get_sidebar(); ?>
38
-
39
- <?php get_footer(); ?>
40
-
41
- ```
42
- sidebar.php
43
- ```
44
- <!-- sidebar -->
45
- <?php if ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar( 'side' ) ) : ?><?php endif; ?>
46
-
47
- <!-- /sidebar -->
48
- ```
49
-
50
- functions.php
51
- ```
52
- <?php
53
-
54
- add_theme_support('post-thumbnails');
55
-
56
- function my_setup() {
57
- add_theme_support( 'post-thumbnails' ); /* アイキャッチ */
58
- add_theme_support( 'automatic-feed-links' ); /* RSSフィード */
59
- add_theme_support( 'title-tag' ); /* タイトルタグ自動生成 */
60
- add_theme_support( 'html5', array( /* HTML5のタグで出力 */
61
- 'search-form',
62
- 'comment-form',
63
- 'comment-list',
64
- 'gallery',
65
- 'caption',
66
- ) );
67
- }
68
- add_action( 'after_setup_theme', 'my_setup' );
69
-
70
-
71
- function my_script_init() {
72
- wp_enqueue_style('style',get_template_directory_uri().'/style.css','',date('YmdGi', filemtime( get_template_directory().'/style.css' )),'' );
73
- wp_deregister_script( 'jquery' );
74
- wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js' );
75
- wp_enqueue_style('jquery ',get_template_directory_uri().'/js/main.js','',date('YmdGi', filemtime( get_template_directory().'/js/main.js' )),'' );
76
- }
77
- add_action( 'wp_enqueue_scripts', 'my_script_init' );
78
-
79
- function twpp_enqueue_scripts() {
80
- wp_enqueue_script(
81
- 'main-script',
82
- get_template_directory_uri() . '/js/main.js'
83
- );
84
- }
85
-
86
- add_action( 'wp_enqueue_scripts', 'twpp_enqueue_scripts' );
87
-
88
- function wpqw_widgets_init() {
89
- register_sidebars( 1, array(
90
- 'name' => 'side',
91
- 'id' => 'side',
92
- 'description' => '説明が入ります',
93
- 'before_widget' => '<div id="%1$s" class="widget %2$s">',
94
- 'after_widget' => '</div>',
95
- 'before_title' => '<h3 class="widget-title">',
96
- 'after_title' => '</h3>',
97
- ) );
98
- }
99
- add_action( 'widgets_init', 'wpqw_widgets_init' );
100
-
101
- ?>
102
-
103
- ```

1

画像追加

2020/05/15 00:04

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -7,6 +7,12 @@
7
7
  これらをちゃんと表示するにはどのようにすればよいのでしょうか?
8
8
 
9
9
  ざっくりした質問で申し訳けありません。
10
+ ### sidebar.phpがある状態
11
+ ![イメージ説明](d5ebb7f95127323c1cf216561a6e270d.png)
12
+
13
+ ### sidebar.phpがない状態
14
+ ![イメージ説明](934aefc1db436e3eaea5517116e4fc2c.png)
15
+
10
16
  ### ソース
11
17
 
12
18
  index.php