Download the PHP package mindkomm/theme-lib-structured-data without Composer
On this page you can find all versions of the php package mindkomm/theme-lib-structured-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mindkomm/theme-lib-structured-data
More information about mindkomm/theme-lib-structured-data
Files in mindkomm/theme-lib-structured-data
Package theme-lib-structured-data
Short Description Structured Data helper classes for WordPress themes
License MIT
Informations about the package theme-lib-structured-data
Structured Data
Structured Data helper classes for WordPress themes.
Supports the following data types:
Installation
You can install the package via Composer:
Usage
Put the generated output into the <head>
of your HTML.
Website
The class checks if it can find a search.php
file in your theme directory and will include a potential search action property accordingly. If you want to have more control over this, you can pass a boolean to the generate_jsonld()
function:
Local Business
A Local Business entry can take a lot of data. The following types of data are supported:
- Contact Data – Address, phone number, email address, etc.
- Geocodes – The latitude and longitude of where the business is located on the map.
- Opening hours – The opening hours of a business.
You need to pass this data when you instantiate the class in the form of an array. Here’s an overview over all the options you can pass in:
Logo
Adds logo markup according to the Structured Data Guide for Logo.
Social Profiles
Links to social profiles such as Facebook, Twitter, Instagram according to the Structured Data Guide for Social Profile.
Usage remarks
- It’s up to you how you want to build this data. You can set up a customizer page or you could use an ACF Options Page as an interface to edit these values.
- If you don’t provide a value for something, it will be ignored in the output.
- Always check your output with the Structured Data Testing Tool.
Credits
Uses the fantastic schema-org library by Spatie.
Support
This is a library that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support.