-
AuthorPosts
-
October 12, 2016 at 7:34 am #7187
SyedTech
GuestHi,
I am designing a website using Frontier theme on localhost. I have almost manage to do all what I need. It is a great theme. SEO will play a major role in this website in future.
I have noticed while testing site html markup on google structured data testing tool that there are some errors if I remove Author, Date Published, etc from post using theme option panel. I don’t want these micro formats on my post page to be present. I have found that if I remove filter frontier_schema I can remove all micro formats but I am unable to remove this filter using command remove_filter(‘frontier_schema’, ‘frontier_get_schema’) in my custom.php file included in last line of the theme functions.php.
It will be very nice if I may able to remove only some micro formats those have invalid/incomplete data.Regards
October 12, 2016 at 7:27 pm #7188Ron
KeymasterTo remove all schema.org markup use this:
add_filter( 'frontier_schema', '__return_empty_string' );
To customize what markup will be used try something like this:
add_filter( 'frontier_schema', 'new_markup' ); function new_markup() { return 'Test'; }
This is just a sample. You can copy and modify the code inside frontier_get_schema() to use as your new_markup() function.
October 13, 2016 at 5:12 pm #7189SyedTech
GuestHi,
Thank you very much. Works great.
I have removed schema.org micro data using add_filter( ‘frontier_schema’, ‘__return_empty_string’ ) and worded as expected. Then added a filter add_filter( ‘frontier_schema’, ‘st_frontier_get_schema’ ) for custom micro data by adding a function in my custom.php file. This function
function st_frontier_get_schema( $name ){
// some code here
}
is called properly but $name parameter does not work so I am unable to track micro data entities.Best regards
October 16, 2016 at 12:19 am #7190Ron
KeymasterOn the parent theme’s function.php, change the original frontier_schema() function to this (I’ll be adding this change on the next theme update):
function frontier_schema( $name ) { $value = frontier_get_schema( $name ); echo apply_filters( 'frontier_schema', $value, $name ); }
Then on your custom php file use something like this:
add_filter( 'frontier_schema', 'st_frontier_get_schema', 10, 2 ); function st_frontier_get_schema( $value, $name ) { // some code here }
-
AuthorPosts
- The forum ‘Frontier’ is closed to new topics and replies.