でこれを実現する簡単な方法を次に示しJavascript
ます。
<script type="text/javascript">
var title = document.title; //title of the page is returned
if(title.indexOf('stop') !== -1) { //If not found, it will return -1
document.getElementById('adsense-bottom').style.display = 'none';
}
</script>
しかし、php
では、次のようにする必要があります
<?php if (in_category('10')) { ?>
<div id="adsense-top">the adsense code</div>
<?php }else { ?>
<script type="text/javascript">
var title = document.title;
if(title.indexOf('stop') !== -1) {
document.getElementById('adsense-bottom').style.display = 'none';
}
</script>
<?php } ?>
このように追加する必要があることを願っています。これが正しい場所かどうかはわかりません。