Skip to content

Commit 061fe99

Browse files
committed
1.0.9
1 parent fabb1b0 commit 061fe99

14 files changed

+278
-64
lines changed

Diff for: author.php

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php get_header(); ?>
2+
<main>
3+
<div class="content list">
4+
<h2 class="list-title">著者:<?php echo get_the_author(); ?></h2>
5+
<?php if (have_posts()):
6+
while (have_posts()):
7+
the_post(); ?>
8+
<a href="<?php echo get_permalink(); ?>">
9+
<div class="opr_col">
10+
<?php if (has_post_thumbnail()): ?>
11+
<?php the_post_thumbnail(); ?>
12+
<?php else: ?>
13+
<img src="https://tella.pages.dev/img/default.jpg" />
14+
<?php endif; ?>
15+
<div class="details">
16+
<h3><?php the_title(); ?></h3>
17+
<time>
18+
<?php if (get_theme_mod("or_main_design_datetime")):
19+
the_time(
20+
get_theme_mod("or_main_design_datetime")
21+
);
22+
else:
23+
the_time("Y年n月j日");
24+
endif; ?></time>
25+
<div class="category">
26+
<?php
27+
$category = get_the_category();
28+
echo "<div>" . $category[0]->name . "</div>";
29+
?>
30+
</div>
31+
</div>
32+
</div>
33+
</a>
34+
<?php
35+
endwhile;
36+
endif; ?>
37+
<?php
38+
$args = [
39+
"mid_size" => 1,
40+
"prev_text" => "&lt;&lt;前へ",
41+
"next_text" => "次へ&gt;&gt;",
42+
"screen_reader_text" => " ",
43+
];
44+
the_posts_pagination($args);
45+
?>
46+
</div>
47+
<?php get_sidebar(); ?>
48+
</main>
49+
<?php get_footer(); ?>
50+
<?php wp_footer(); ?>

Diff for: blocks/linkcard/block.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
el("p", null, "URLを入力"),
5959
el(RichText, {
6060
tagName: "a",
61-
className: "linkcard " + props,
61+
className: "or-linkcard " + props,
6262
placeholder: "https://example.com",
6363
value: content,
6464
allowedFormats: [],
@@ -75,7 +75,7 @@
7575
return [
7676
el(RichText.Content, {
7777
tagName: "a",
78-
className: "linkcard " + props,
78+
className: "or-linkcard " + props,
7979
value: content,
8080
}),
8181
];

Diff for: blocks/linkcard/index.php

+26-8
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,42 @@
1717

1818
function OR_linkcard($attributes)
1919
{
20-
$content = OpenGraph::fetch($attributes["content"]);
20+
$url = $attributes["content"];
21+
$content = OpenGraph::fetch($url);
22+
$page = mb_convert_encoding(file_get_contents($url), "utf-8", "auto");
23+
preg_match("/<title>(.*?)</title>/", $page, $res);
24+
$tags = get_meta_tags($url);
25+
$description = @$tags["description"] ? $tags["description"] : "NULL";
26+
$title = $res[1];
2127
$html = "";
2228
$html .=
2329
'<a href="' .
2430
$attributes["content"] .
25-
'" class="linkcard ' .
31+
'" class="or-linkcard ' .
2632
$attributes["className"] .
2733
'">';
2834
if ($content->image):
29-
$html .= '<img src="' . $content->image . '" class="linkcard-image" />';
35+
$html .=
36+
'<img src="' . $content->image . '" class="or-linkcard-image" />';
37+
endif;
38+
if ($content->title):
39+
$html .=
40+
"<div class='details'><p class='or-linkcard-title'>" .
41+
$content->title .
42+
"</p>";
43+
elseif ($title):
44+
$html .=
45+
"<div class='details'><p class='or-linkcard-title'>" .
46+
$title .
47+
"</p>";
3048
endif;
31-
$html .=
32-
"<div class='details'><p class='linkcard-title'>" .
33-
$content->title .
34-
"</p>";
3549
if ($content->description):
3650
$html .=
37-
"<p class='linkcard-description'>" . $content->description . "</p>";
51+
"<p class='or-linkcard-description'>" .
52+
$content->description .
53+
"</p>";
54+
elseif ($description):
55+
$html .= "<p class='or-linkcard-description'>" . $description . "</p>";
3856
endif;
3957
$html .= "</div></a>";
4058
return $html;

Diff for: blocks/linkcard/style.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
.linkcard-wrapper {
1+
.or-linkcard-wrapper {
22
display: block;
33
padding: 1rem;
44
background-color: rgb(243, 243, 243);
55
}
66

7-
.linkcard-wrapper p {
7+
.or-linkcard-wrapper p {
88
margin: 0;
99
margin-bottom: 0.5rem;
1010
}
1111

12-
.editor-styles-wrapper a.linkcard {
12+
.editor-styles-wrapper a.or-linkcard {
1313
display: block;
1414
padding: 0.5rem;
1515
font-size: 0.875rem;

Diff for: category.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
while (have_posts()):
77
the_post(); ?>
88
<a href="<?php echo get_permalink(); ?>">
9-
<div class="col">
9+
<div class="opr_col">
1010
<?php if (has_post_thumbnail()): ?>
1111
<?php the_post_thumbnail(); ?>
1212
<?php else: ?>
@@ -15,17 +15,17 @@
1515
<div class="details">
1616
<h3><?php the_title(); ?></h3>
1717
<time>
18-
<?php if (get_theme_mod('or_main_design_datetime')):
18+
<?php if (get_theme_mod("or_main_design_datetime")):
1919
the_time(
20-
get_theme_mod('or_main_design_datetime')
20+
get_theme_mod("or_main_design_datetime")
2121
);
2222
else:
23-
the_time('Y年n月j日');
23+
the_time("Y年n月j日");
2424
endif; ?></time>
2525
<div class="category">
2626
<?php
2727
$category = get_the_category();
28-
echo '<div>' . $category[0]->name . '</div>';
28+
echo "<div>" . $category[0]->name . "</div>";
2929
?>
3030
</div>
3131
</div>
@@ -36,10 +36,10 @@
3636
endif; ?>
3737
<?php
3838
$args = [
39-
'mid_size' => 1,
40-
'prev_text' => '&lt;&lt;前へ',
41-
'next_text' => '次へ&gt;&gt;',
42-
'screen_reader_text' => ' ',
39+
"mid_size" => 1,
40+
"prev_text" => "&lt;&lt;前へ",
41+
"next_text" => "次へ&gt;&gt;",
42+
"screen_reader_text" => " ",
4343
];
4444
the_posts_pagination($args);
4545
?>

Diff for: css/customizer.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/* customize */
2-
#customize-control-or_list_design_view .customize-inside-control-row {
2+
.customize-control-image-label-radio .customize-inside-control-row {
33
margin: 0;
44
}
55

6-
#customize-control-or_list_design_view input[type='radio'] {
6+
.customize-control-image-label-radio input[type='radio'] {
77
display: none;
88
}
99

10-
#customize-control-or_list_design_view input[type='radio'] + label {
10+
.customize-control-image-label-radio input[type='radio'] + label {
1111
display: block;
1212
}
13-
#customize-control-or_list_design_view input[type='radio'] + label img {
13+
.customize-control-image-label-radio input[type='radio'] + label img {
1414
border: 3px solid transparent;
1515
-webkit-transition: border 0.3s;
1616
transition: border 0.3s;
1717
}
1818

19-
#customize-control-or_list_design_view input[type='radio']:checked + label img {
19+
.customize-control-image-label-radio input[type='radio']:checked + label img {
2020
border-color: #2980b9;
2121
}
2222
#customize-controls .customize-control-sidebar_block_editor h3 {

Diff for: functions.php

+17-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ function custom_mime_types($mimes)
2121
}
2222
add_filter("upload_mimes", "custom_mime_types");
2323

24-
add_action(
25-
"customize_controls_enqueue_scripts",
26-
"or_customize_controls_enqueue_scripts"
27-
);
2824
function or_customize_controls_enqueue_scripts()
2925
{
3026
wp_enqueue_script(
@@ -39,6 +35,10 @@ function or_customize_controls_enqueue_scripts()
3935
get_template_directory_uri() . "/css/customizer.css"
4036
);
4137
}
38+
add_action(
39+
"customize_controls_enqueue_scripts",
40+
"or_customize_controls_enqueue_scripts"
41+
);
4242
add_theme_support("custom-logo");
4343

4444
require "lib/update-checker/plugin-update-checker.php";
@@ -106,3 +106,16 @@ function or_register_block_loop($BlockDir)
106106
}
107107

108108
add_action("init", "or_register_block");
109+
110+
function custom_user_meta($wb)
111+
{
112+
$wb["twitter"] = __("Facebook ユーザー名", "text_domain");
113+
$wb["twitter"] = __("Twitter ユーザー名", "text_domain");
114+
$wb["github"] = __("Github URL", "text_domain");
115+
$wb["telegram"] = __("Telegram URL", "text_domain");
116+
$wb["youtube"] = __("Youtube URL", "text_domain");
117+
$wb["discord"] = __("Discord URL", "text_domain");
118+
$wb["soundcloud"] = __("Soundcloud URL", "text_domain");
119+
return $wb;
120+
}
121+
add_filter("user_contactmethods", "custom_user_meta");

Diff for: header.php

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<title><?php the_title(); ?> | <?php bloginfo("name"); ?></title>
1616
<?php elseif (is_category() || is_tag()): ?>
1717
<title><?php single_cat_title(); ?> | <?php bloginfo("name"); ?></title>
18+
<?php elseif (is_author()): ?>
19+
<title><?php echo get_the_author(); ?> | <?php bloginfo("name"); ?></title>
1820
<?php else: ?>
1921
<title><?php the_title(); ?> | <?php bloginfo("name"); ?></title>
2022
<?php endif; ?>

Diff for: img/hs0.png

3.11 KB
Loading

Diff for: img/hs1.png

3.72 KB
Loading

Diff for: inc/customizer.php

+44-6
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,22 @@ function or_customize($wp_customize)
217217
])
218218
);
219219

220+
$wp_customize->add_setting("or_single_design_heading");
221+
$wp_customize->add_control(
222+
new OR_Customize_Image_Label_Radio_Control(
223+
$wp_customize,
224+
"or_single_design_heading",
225+
[
226+
"label" => "見出しスタイル",
227+
"section" => "or_single_design",
228+
"choices" => [
229+
"default" => get_template_directory_uri() . "/img/hs0.png",
230+
"heading1" => get_template_directory_uri() . "/img/hs1.png",
231+
],
232+
]
233+
)
234+
);
235+
220236
$wp_customize->add_section("or_mobile_design", [
221237
"title" => "モバイル",
222238
"panel" => "or_design",
@@ -437,14 +453,14 @@ function theme_customize_css()
437453
<?php endif; ?>
438454
}
439455
<?php if (get_theme_mod("or_main_design_rounded")): ?>
440-
.content.list a:not(.page-numbers), .content.list a .col, .content.article .size-post-thumbnail, .content.article .toc {
456+
.content.list a:not(.page-numbers), .content.list a .opr_col, .content.article .size-post-thumbnail, .content.article .toc {
441457
border-radius: 1rem;
442458
}
443459
.content.article blockquote {
444460
border-top-right-radius: 1rem;
445461
border-bottom-right-radius: 1rem;
446462
}
447-
.content.list a .col img {
463+
.content.list a .opr_col img {
448464
border-top-left-radius: 1rem;
449465
border-top-right-radius: 1rem;
450466
}
@@ -546,7 +562,7 @@ function theme_customize_css()
546562
}
547563
<?php endif; ?>
548564
<?php if (get_theme_mod("or_list_design_eyecatch")): ?>
549-
.content.list a .col img {
565+
.content.list a .opr_col img {
550566
display: none;
551567
}
552568
<?php endif; ?>
@@ -559,19 +575,41 @@ function theme_customize_css()
559575
.content.list {
560576
display: flex;
561577
}
562-
.content.list a .col img {
578+
.content.list a .opr_col img {
563579
width: 30%;
564580
height: auto;
565581
border-top-left-radius: 1rem;
566582
border-bottom-left-radius: 1rem;
567583
border-top-right-radius: 0;
568584
}
569-
.content.list a .col {
585+
.content.list a .opr_col {
570586
flex-direction: row;
571587
gap: 16px;
572588
}
573589
}
574-
590+
<?php endif; ?>
591+
<?php if (get_theme_mod("or_single_design_heading") == "heading1"): ?>
592+
.content.article h1 {
593+
font-size: 1.75rem;
594+
padding-top: 0.4em;
595+
padding-bottom: 0.4em;
596+
border-top: 3px solid #000;
597+
border-bottom: 3px solid #000;
598+
}
599+
.content.article h2:not(.title) {
600+
padding-top: 0.55em;
601+
padding-bottom: 0.5em;
602+
padding-left: 0.5em;
603+
font-size: 1.4rem;
604+
background-color: #f6f6f6;
605+
border-left: 4px solid #222222;
606+
}
607+
.content.article h3 {
608+
font-size:1.3em;
609+
padding-bottom: 0.25em;
610+
line-height: 1.4;
611+
border-bottom: 1px solid #222222;
612+
}
575613
<?php endif; ?>
576614
</style>
577615
<?php

Diff for: index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$ads_infeed_count++;
2424
?>
2525
<a href="<?php echo get_permalink(); ?>">
26-
<div class="col">
26+
<div class="opr_col">
2727
<?php if (has_post_thumbnail()): ?>
2828
<?php the_post_thumbnail(); ?>
2929
<?php else: ?>

0 commit comments

Comments
 (0)