PHP code example of mindkomm / theme-lib-structured-data
1. Go to this page and download the library: Download mindkomm/theme-lib-structured-data library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mindkomm / theme-lib-structured-data example snippets
add_action( 'wp_head', function() {
// Local Business
$local_business = new Theme\Structured_Data\Local_Business( $options );
echo $local_business->generate_jsonld();
// Website
$website = new Theme\Structured_Data\Website();
echo $website->generate_jsonld();
// Logo
$logo = new Theme\Structured_Data\Logo( $logo_url );
echo $logo->generate_jsonld();
// Social profiles
$social_profiles = new Theme\Structured_Data\Social_Profile( $social_profiles );
echo $social_profiles->generate_jsonld();
} );
// Use SearchAction, ignore check for search.php file.
echo $website->generate_jsonld( true );