Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introducing <meta> tags of OpenGraph and twitter card in header.php for #552 #553

Merged
merged 3 commits into from
Dec 9, 2022

Conversation

n0099
Copy link
Contributor

@n0099 n0099 commented Nov 18, 2022

@seatonjiang seatonjiang merged commit 29366cb into seatonjiang:main Dec 9, 2022

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo $title; ?>">
<meta name="twitter:creator" content="<?php echo the_author(); ?>">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主页无法使用,并且 the_author() 需要在文章主循环中使用

    if (is_single() || is_singular()) {
        global $post;
        $author_id = $post->post_author;
        echo '<meta name="twitter:creator" content="' . get_the_author_meta('nickname',  $author_id) . '">';
    }

@n0099
Copy link
Contributor Author

n0099 commented Mar 28, 2023

094dc54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants