Package Flashcards

1
Q

Advanced Custom Fields 를 설치하고

글이나 페이지에 등록을 해두면

A

아래에 필드가 생긴다

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ACF 설정을

만든 post type에다

동록해두면

admin bar의 그

A

post type 에서만 필드가 생긴다

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ACF에서 필드를 지정하면

A

field name 이 생긴다.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

특정 페이지에 영구적으로 할당된 URL 주소

A

permalink

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

URL에서 특정 페이지를 나타내는 부분

A

slug

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
// Link to the queries file
require get_template_directory() . '/inc/queries.php';

무슨 코드인가?

A

따로 만든 post type은

기본 워드프레스 내장이 아니라서 템플릿에서 바로 못쓰는데

functions.php 에서 require 하면 사용할 수 있다.

그래서 등록한 거다.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

$args = array(
‘post_type’ => ‘gymfitness_classes’,
‘posts_per_page’ => $number
);
// Use WP_Query and append the results into $classes
$classes = new WP_Query($args);
while($classes->have_posts()): $classes->the_post();

무슨 코드일 것 같나?

A

워드프레스가 인식하지 못하는 custom post type을

표시하는 함수의 일부일 것

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

$args = array(
‘post_type’ => ‘gymfitness_classes’,
‘posts_per_page’ => $number
);
// Use WP_Query and append the results into $classes
$classes = new WP_Query($args);

custom post type에 쿼리를 주는 코드다.

‘gymfitness_classes’, 저건 플러그인에서 어떤 함수에 등록되는가?

A

register_post_type( ‘gymfitness_classes’, $args );

$args는 각종 변수들이다

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

워드프레스 내에서

검색을 하거나, 댓글을 찾거나, 권한을 찾는 것 처럼

필요한 정보를 찾기위한 객체

A

WP_Query()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

WP_Query()는 보통

A

템플릿 쪽으로 무언가 보여줄 때 사용한다

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

글을 무작위로 표시하는 걸

WP_Query()로 다룰 수 있다 OX

A

O

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

WP_Query로 루프작업을 한 뒤에

워드프레스가 올바르게 동작하기 위해서 사용해야하는 함수

A

wp_reset_postdata()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

쿼리에

루프 작업을 한 후에는

A

wp_reset_postdata() 를 반드시 써야한다

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

현재 페이지의 permalink 표시

A

the_permalink()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

the_post_thumbnail()
the_permalink()
the_title()
get_field()

같은 함수들은 루프를 돌릴때

A

루프도중 처리되는

각 값에 대해서만 따로 반환한다.

(전체로 처리되지 않는다)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ACF 에서

the_field() 는

A

값을 바로 표시한다

17
Q

ACF 에서

get_field() 는

A

값을 반환한다.

보통 변수에 넣는다.