Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
sora
/
achievement
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f7fe8e49
authored
Apr 15, 2022
by
Orine Matsui
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
本番サーバDL、投稿先頭固定機能反映
parent
4ebae9d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
40 deletions
achievement-official.conohawing.com/wp-content/themes/achievement/functions.php
achievement-official.conohawing.com/wp-content/themes/achievement/index.php
achievement-official.conohawing.com/wp-content/themes/achievement/functions.php
View file @
f7fe8e49
...
...
@@ -164,47 +164,7 @@ function my_remove_post_support()
add_action
(
'init'
,
'my_remove_post_support'
);
/*===================================
OGPタグ
===================================*/
function
my_meta_ogp
()
{
if
(
is_front_page
()
||
is_home
()
||
is_singular
()
){
global
$post
;
$ogp_title
=
''
;
$ogp_descr
=
''
;
$ogp_url
=
''
;
$ogp_img
=
''
;
$insert
=
''
;
if
(
is_singular
()
)
{
//記事&固定ページ
setup_postdata
(
$post
);
$ogp_title
=
$post
->
post_title
;
$ogp_descr
=
mb_substr
(
get_the_excerpt
(),
0
,
100
);
$ogp_url
=
get_permalink
();
wp_reset_postdata
();
}
elseif
(
is_front_page
()
||
is_home
()
)
{
//トップページ
$ogp_title
=
get_bloginfo
(
'name'
);
$ogp_descr
=
get_bloginfo
(
'description'
);
$ogp_url
=
home_url
();
}
//og:type
$ogp_type
=
(
is_front_page
()
||
is_home
()
)
?
'website'
:
'article'
;
//og:image
if
(
is_singular
()
&&
has_post_thumbnail
()
)
{
$ps_thumb
=
wp_get_attachment_image_src
(
get_post_thumbnail_id
(),
'full'
);
$ogp_img
=
$ps_thumb
[
0
];
}
else
{
$ogp_img
=
'https://achievement.co.jp/assets/img/common/ogp.jpg'
;
}
//facebookのapp_id(設定する場合)$insert .= '<meta property="fb:app_id" content="ここにappIDを入力">' . "\n";
echo
$insert
;
}
}
//END my_meta_ogp
add_action
(
'wp_head'
,
'my_meta_ogp'
);
//headにOGPを出力
/*===================================
mark new post
===================================*/
...
...
achievement-official.conohawing.com/wp-content/themes/achievement/index.php
View file @
f7fe8e49
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment