Skip to content

Instantly share code, notes, and snippets.

@justinswelch
Last active October 2, 2019 11:12
Show Gist options
  • Save justinswelch/c3a6400cc7c266f4979f9552554ac031 to your computer and use it in GitHub Desktop.
Save justinswelch/c3a6400cc7c266f4979f9552554ac031 to your computer and use it in GitHub Desktop.
<?php
/**
*-----------------------------------------------------------
* Add publisher logo/image schema for Beaver Builder plugin
*-----------------------------------------------------------
*
* Filter: 'fl_schema_meta_publisher_image_url'
* Defined in: bb-plugin/modules/post-grid/post-grid.php
*
* Why this is necessary (as of 10/17/18):
* The posts module from the BB plugin gets the company logo
* used for article schema from the BB theme. In at least some
* cases, themes other than BB theme may generate schema errors
* due to the logo not being defined for the posts module.
*
* Google's Structured Data Testing Tool:
* https://search.google.com/structured-data/testing-tool
*
* Note: Ideally this logo url will be defined by a custom field,
* site settings or a new BB plugin settings (not hardcoded).
*----------------------------------------------------------*/
function SetBeaverSchemaLogoUrl( $image ) {
// #todo: adjust the path to your logo url
return get_stylesheet_directory_uri() . '/dist/img/logo.png';
}
add_filter( 'fl_schema_meta_publisher_image_url', 'SetBeaverSchemaLogoUrl', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment