質問編集履歴
5
ソースコード一部訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,7 +10,9 @@
|
|
10
10
|
上の関数では下記の``// B``でしか使えませんが、クラス付与したいのは下記の``<!-- A -->``なんです。
|
11
11
|
|
12
12
|
```php
|
13
|
-
<?php $args = array(
|
13
|
+
<?php $args = array(
|
14
|
+
//いろいろ
|
15
|
+
); ?>
|
14
16
|
<div class="count<!-- A -->">
|
15
17
|
<?php $the_query = new WP_Query( $args );?>
|
16
18
|
<?php if ( $the_query->have_posts() ) : ?>
|
4
ソースコード一部訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
上の関数では下記の``// B``でしか使えませんが、クラス付与したいのは下記の``<!-- A -->``なんです。
|
11
11
|
|
12
12
|
```php
|
13
|
-
<?php $args = array(
|
13
|
+
<?php $args = array( 'posts_per_page' => -1 ); ?>
|
14
14
|
<div class="count<!-- A -->">
|
15
15
|
<?php $the_query = new WP_Query( $args );?>
|
16
16
|
<?php if ( $the_query->have_posts() ) : ?>
|
3
<?php ;?>の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,9 +10,7 @@
|
|
10
10
|
上の関数では下記の``// B``でしか使えませんが、クラス付与したいのは下記の``<!-- A -->``なんです。
|
11
11
|
|
12
12
|
```php
|
13
|
-
$args = array(
|
14
|
-
|
13
|
+
<?php $args = array( // いろいろ );?>
|
15
|
-
);
|
16
14
|
<div class="count<!-- A -->">
|
17
15
|
<?php $the_query = new WP_Query( $args );?>
|
18
16
|
<?php if ( $the_query->have_posts() ) : ?>
|
2
修正依頼を受けてソースコードを追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,7 +10,11 @@
|
|
10
10
|
上の関数では下記の``// B``でしか使えませんが、クラス付与したいのは下記の``<!-- A -->``なんです。
|
11
11
|
|
12
12
|
```php
|
13
|
+
$args = array(
|
14
|
+
// いろいろ
|
15
|
+
);
|
13
16
|
<div class="count<!-- A -->">
|
17
|
+
<?php $the_query = new WP_Query( $args );?>
|
14
18
|
<?php if ( $the_query->have_posts() ) : ?>
|
15
19
|
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
|
16
20
|
<?php echo loopPostCount(); // B ?>
|
1
AB変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,13 +7,13 @@
|
|
7
7
|
return ($wp_query->post_count);
|
8
8
|
}
|
9
9
|
```
|
10
|
-
上の関数では下記の
|
10
|
+
上の関数では下記の``// B``でしか使えませんが、クラス付与したいのは下記の``<!-- A -->``なんです。
|
11
11
|
|
12
12
|
```php
|
13
13
|
<div class="count<!-- A -->">
|
14
14
|
<?php if ( $the_query->have_posts() ) : ?>
|
15
15
|
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
|
16
|
-
<?php echo loopPostCount(); //B ?>
|
16
|
+
<?php echo loopPostCount(); // B ?>
|
17
17
|
<h2><?php the_title(); ?></h2>
|
18
18
|
<?php endwhile; ?>
|
19
19
|
<?php wp_reset_postdata(); ?>
|