Hi, I am trying to add schema mark up to a single page of my website. I have created all my websites pages using the advanced layout editor. The schema mark up program I am using has told me to paste the json-ld in the head section of your html document.
How do I do this for only one web page as I can not add it in the html text section in page builder because I used the advanced layout editor to build this page https://www.screencast.com/t/DzPSc8dWYd
Hey James2200,
Try adding this code to the end of your functions.php file in Appearance > Editor:
function custom_schema(){
if( is_page( 123 ) ) {
?>
<script>
//Your Script Here
</script>
<?php
}
}
add_action('wp_header', 'custom_schema');
where “is_page( 123 )” please change to your page id number
Best regards,
Mike
Hi thanks for your reply when I click appearance I do not see an option for editor https://www.screencast.com/t/c5uMSCyg19l
Also, could you take a look at this screencast https://www.screencast.com/t/HkXJ60gJ9V
Hi,
I see you have a security plugin, perhaps there is a setting that disables your editor?
If you can’t find how to enable your editor, try editing your functions.php file via FTP.
Yes, remove //Your Script Here
and add your script.
Best regards,
Mike
I did not see an option in the security setting. Would you like credentials to look for yourself
Hi James2200,
The editor is hidden by this code in wp-config.php
define( 'DISALLOW_FILE_EDIT', true );
You can set it to “false” and then add the code, or just add the code given by Mike via FTP.
Best regards,
Victoria
thanks for that
I tried adding the code through the editor option but it did not except it and said I should try manually through FTP but I am not sure about doing it that way and have decided to outsource the job