<?php
add_filter( 'default_content', 'custom_editor_content' );
function custom_editor_content( $content ) {
global $page_type;
$page_type = is_page_template('Lessons.php');
if ( $page_type ) {
$content = '
<div id=”Tabs”>
<ul>
<li id="li_tab1" onclick="tab(‘tab1')"><a>Watch</a></li>
<li id="li_tab2" onclick=”tab('tab2')”><a>Read/Listen</a></li>
<li id="li_tab3" onclick=”tab('tab3')”><a>Recall</a></li>
<li id="li_tab4" onclick=”tab('tab4')”><a>Understand</a></li>
</ul>
<div id="Content_Area">
<div id="tab1">
<p>This is the text for tab 1</p>
</div>
<div id="tab2">
<p>This is the text for tab 1</p>
</div>
<div id="tab3">
<p>This is the text for tab 1</p>
</div>
<div id="tab4">
<p>This is the text for tab 1</p>
</div>
';
}
else {
$content = '
// TEMPLATE FOR EVERYTHING ELSE
';
}
return $content;
}
?>
Why does this throw an error in the onclick section? (I have the javascript code elsewhere). The goal is to include this dynamic content by default in wordpress. but it won’t let me call the function within onclick.