Skip to content

Instantly share code, notes, and snippets.

View schemapress's full-sized avatar

Schema.Press schemapress

View GitHub Profile
@schemapress
schemapress / schema-blog-output-remove.php
Created November 13, 2018 00:56
Remove Schema Plugin markup for Blog on home page https://schema.press/docs/remove-blog-markup/
<?php //* do not include php tag
add_filter( 'schema_blog_output', 'schema_blog_output_remove_8987716235' );
/**
* Remove Schema Plugin markup for Blog on home page
*
* @param array $schema
* @return array
*/
function schema_blog_output_remove_8987716235( $schema ) {
@schemapress
schemapress / schema-wp-override-description-yoast-seo.php
Last active October 3, 2018 04:50
Override Schema description value with Yoast SEO description https://schema.press
<?php //* do not include php tag
add_filter( 'schema_output', 'schema_wp_override_description_yoast_seo_12345' );
/*
* Override Schema description value with Yoast SEO description
*/
function schema_wp_override_description_yoast_seo_12345( $schema_output ) {
// get description value from Yoast SEO post meta
$desc = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true);
@schemapress
schemapress / schema-wp-add-new-type.php
Last active August 12, 2018 03:12
Extend Schema.org Types options of the WordPress Schema plugin https://schema.press/docs/adding-support-new-schema-org-types/
<?php //* do not include php tag
add_filter( 'schema_wp_types', 'schema_wp_new_add_schema_type_7623456' );
/**
* Add New type to Schema Types options
*
* @since 1.0
*/
function schema_wp_new_add_schema_type_7623456( $options ) {
@schemapress
schemapress / schema-truncating-headlines.php
Created July 14, 2018 11:34
Truncating Headlines by characters count in Schema Plugin https://schema.press/docs/truncating-headlines/
<?php //* do not include php tag
add_filter('schema_wp_filter_headline', 'truncating_headlines_chars_567545256');
/**
* Schema Plugin: Truncating Headlines by characters count
*
* @since 1.0
*/
function truncating_headlines_chars_567545256( $headline ) {
<?php //* do not include php tag
add_filter('schema_wp_filter_headline', 'truncating_headlines_words_567545256');
/**
* Schema Plugin: Truncating Headlines by words count
*
* @since 1.0
*/
function truncating_headlines_words_567545256( $headline ) {
@schemapress
schemapress / schema_wp_markup_output_in_content.php
Created October 25, 2017 20:09
Add schema.org markup generated by Schema plugin to the content https://schema.press/
<?php //* do not include php tag
add_filter('the_content','my_schema_wp_markup_output_in_content_6876867');
/**
* Add schema.org markup generated by Schema plugin to the content
*
* return string
*/
function my_schema_wp_markup_output_in_content_6876867( $content ) {
<?php //* do not include php tag
/*
* A few ways to disable Schema plugin breadcrumbs json-ld output
*
* @since 1.6.9.5
*/
//------------------- (1)
//
@schemapress
schemapress / schema-wp-extend-output.php
Last active September 28, 2017 19:43
Extend / Override Schema.org JSON_LD Output https://schema.press/docs/extend-schema-output/
<?php //* do not include php tag
add_filter('schema_output', 'schema_wp_extend_output_987345256');
/**
* Extend / Override Schema Output
*
* @since 1.0
*/
function schema_wp_extend_output_987345256( $schema ) {
@schemapress
schemapress / schema_wp_extend_output_articleBody.php
Created September 28, 2017 18:23
Add articleBody to Schema Output in Schema Plugin https://schema.press
<?php //* do not include php tag
add_filter('schema_output', 'schema_wp_extend_output_articleBody_98738765');
/**
* Add articleBody to Schema Output
*
* @since 1.0
*/
function schema_wp_extend_output_articleBody_98738765( $schema ) {
@schemapress
schemapress / schema-wp-shorten-headline.php
Created September 24, 2017 21:56
Shorten and Limit Headline by 110 characters for Schema plugin https://schema.press/
<?php //* do not include php tag
add_filter('schema_output', 'schema_wp_shorten_headline_output_98734524456');
/**
* Shorten / Limit Headline in Schema Output
*
* String length of headline must be in range [0, 110]
*
* @since 1.0
*/