admin管理员组文章数量:1334818
I am trying to remove the default WordPress icon that displays on oembed links when there is no site icon. Here is a link to the site(3 links at the bottom) /. I have tried altering the code from the embed_site_title_html
function and adding it to my theme's functions.php file. This is how I added it:
function groovy() {
$site_title = sprintf(
esc_url( home_url() ),
esc_html( get_bloginfo( 'name' ) )
);
$site_title = '<div class="wp-embed-site-title">' . $site_title . '</div>';
return $site_title;
}
add_filter( 'embed_site_title_html', 'groovy', 10, 2 );
I removed the code that linked to the icon. It did not work. I also tried using CSS to hide it with this code:
add_action( 'embed_footer', 'embed_custom_footer_style' );
function embed_custom_footer_style(){ ?>
<style>
.wp-embed-site-icon {
display: none;
}
</style>
I also copied the embed-content.php file from the includes folder and removed the icon image. Here is a link to the file in pastebin:
I am stumped as to why nothing seems to be working.
I am trying to remove the default WordPress icon that displays on oembed links when there is no site icon. Here is a link to the site(3 links at the bottom) https://libsource/library-as-a-service/roadmapping-and-consulting-services/library-resource-analysis/. I have tried altering the code from the embed_site_title_html
function and adding it to my theme's functions.php file. This is how I added it:
function groovy() {
$site_title = sprintf(
esc_url( home_url() ),
esc_html( get_bloginfo( 'name' ) )
);
$site_title = '<div class="wp-embed-site-title">' . $site_title . '</div>';
return $site_title;
}
add_filter( 'embed_site_title_html', 'groovy', 10, 2 );
I removed the code that linked to the icon. It did not work. I also tried using CSS to hide it with this code:
add_action( 'embed_footer', 'embed_custom_footer_style' );
function embed_custom_footer_style(){ ?>
<style>
.wp-embed-site-icon {
display: none;
}
</style>
I also copied the embed-content.php file from the includes folder and removed the icon image. Here is a link to the file in pastebin: https://pastebin/XmXRYui7
I am stumped as to why nothing seems to be working.
Share Improve this question asked Apr 6, 2017 at 12:51 Web CanvasesWeb Canvases 12 bronze badges1 Answer
Reset to default 1Here's the code to remove the site icon markup from embeds:
add_filter('get_site_icon_url','__return_false', 10, 3);
If you want to remove the entire site-icon + site-title then use this:
add_filter('embed_site_title_html','__return_false');
The right thing to do though would be to upload your own site-icon in the WordPress customizer and show-off your branding. Min image size it needs is 512px.
本文标签: embedRemoving WordPress Icon from oembed link footer
版权声明:本文标题:embed - Removing WordPress Icon from oembed link footer 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742375558a2463090.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论