Theme Flashcards

1
Q

.current-page-item은 언제 어디에 있는가?

A

현재있는 페이지를 나타내는 클래스다.

.main-menu 클래스 아래에 있다.

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

header나 footer 만들 때 둘다 거의

A

wp_nav_menu() 를 사용한다

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

현재 블로그의 정보를 얻는 함수

A

get_bloginfo()

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

뭔가 표시하고 싶다면

A

그게 page인지 post인지 확인하고

th 찾아서

알맞은 템플릿 태그 넣으면 된다

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

템플릿 태그들은

A

알맞은 파일을 대신 불러온다

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

SEO에 더 도움을 주기 위해서

A

header footer 같은 시멘틱 태그들을 써야한다

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

시멘틱 태그들은 실제로 문서에

A

영향을 주진 않는다

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

테마가 로드된 후에 실행되는 훅 등록하는 거

A

after_setup_theme

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

테마에다가

기능을 등록하는 거

( 글의 썸네일등을 등록할 수 있음 )

A

add_theme_support()

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

add_theme_support(‘post-thumbnails’);

A

post, page에

featured image 섹션이 생긴다

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

featured image를 템플릿에서 표시하려면

A

the_post_thumbnail()

를 사용해야한다

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

if(has_post_thumbnail()):
echo “there is image”;
else:
echo “no image”;
endif;

무슨 코드인가?

A

템플릿에서 이미지의 유무에 따라 처리하는 코드다

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

웹사이트에서 이미지 로딩하는 데 오래걸리면

A

Image를 regenerate 해야한다

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

새로운 이미지 사이즈 등록하는 함수

A

add_image_size()

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

add_image_size로 등록하면

A

만든 alias로

썸네일을 다시 만들 수 있다

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

썸네일을 다시 만드는데

반드시 필요한 플러그인

A

Regenerate Thumbnails

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

Regenerate Thumbnails에서

썸네일이 만들어지는 기준은

A

add_image_size 에서 지정한 거로

만들어진다

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

만들어진 썸네일을 템플릿에서 표시하려면

A

the_post_thumbnail(‘square’);
the_post_thumbnail(‘portrait’);

처럼

Regenerate Thumbnails로 만든 후에

functions.php 에서 add_image_size로 지정한 alias를 입력하면 된다

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

.page.no-sidebar

무슨 선택자인가?

A

저걸 선택한다

20
Q

featured image 에서

클래스 이름을 바꾸려면?

A

the_post_thumbnail(‘blog’, array(
‘class’ => ‘featured-image’,
));

21
Q

사실 모든 워드프레스 테마는

A

템플릿 파일의 모음이다

22
Q

페이지의 특성에 따라서 써야할

A

템플릿 계층이 따로 있다

23
Q

Page attributes의

template 서브 메뉴는

A

서브 메뉴에서 빠지고

사이드 메뉴에 있다

24
Q

post나 page 별로

템플릿을 만들어서

편리하게

A

바로 바로 교체할 수 있다

25
위젯 등록하려면
functions.php의 register_sidebar()를 이용해야한다
26
Widget은
Sidebar이다
27
기본 위젯이 등록된 후 실행되는 훅
widgets_init
28
템플릿에서 Widget (Sidebar)를 표시하는 거
dynamic_sidebar(등록한 사이드 바 ID)
29
if(is_active_sidebar()): dynamic_sidebar(); endif; 무슨 의미?
그 사이드바가 활성화됬다면 표시
30
템플릿에서 sidebar를 표시하려면
sidebar.php를 만들고 템플릿에서 get_sidebar()로 가져와야 한다
31
테마에서 중복된 템플릿들을 리펙토링하면서 모아둔 폴더
template-parts
32
template-parts/page-loop.php를 사용하려면 어떻게 해야하는가?
템플릿 엔진에다가 get_template_part( 'template-parts/page', 'loop' ) 이렇게 가져오면 된다
33
워드프레스가 어떤 data, content를 구분하는 기준
Post type
34
기본적으로 워드프레스가 가진 post type 갯수
7개
35
워드프레스의 post type :
post page attachment nav menu revision custom css changeset
36
새로 만든 Post type의 글을 "템플릿"에서 표시하려면
custom query를 사용해야한다
37
테마나 플러그인에 post type 만들 수 있다 OX
O
38
글에다가 전화번호 / 영업시간 / 요일등을 추가하고싶으면
ACF로 Custom field를 추가해야한다
39
Post type을 활용하면 관리하기 더 쉽다 OX
O
40
post type을 만들기 위해서 제일 먼저
플러그인으로 새로 만들어야한다
41
post type 플러그인에서 $args 의 hierarchical => false 뭘 의미하는가?
자식 포스트가 없다는 걸 의미함
42
따로 만든 post type 을 위한 템플릿을 따로 만들려면
single-posttype.php 라는 템플릿 파일을 워드프레스가 인식하기 위해 만들어야한다. ( template hierarchy 따라가면 나온다 )
43
사실 Template Hierarchy는
워드프레스에 인식시키기 위해 어떻게 템플릿 파일 이름을 지어야 하는지 알려주는 게 목적이다
44
템플릿에서 현재 글의 타입을 알고싶다면?
get_post_type()
45
if (has_post_thumbnail()): the_post_thumbnail('blog', array('class' => 'featured-image')); endif; // Check the current post type if (get_post_type() === 'gymfitness_classes'): $start_time = get_field('start_time'); $end_time = get_field('end_time');

... 무슨 코드인가?
템플릿에서 특정 post type 이면 어떤 기간을 표시하고 있다
46
지금 어떤 파일 내부이고 image[0]의 의미는?
템플릿 파일에서 post loop 도중에 그 글에 대한 갤러리를 얻어와서 exploding 하고나서 각 value의 0번 인덱스를 이미지 태그에 표시하고 있다