php - How to display title of page in body content under h1 tag -



php - How to display title of page in body content under h1 tag -

i have used rsseo plugin optimizing joomla site, want h1 tag in custom components , pages similar page title. tried below

<h1> <script type="text/javascript"> <!-- document.write(document.title); //--> </script></h1>

the above script able display h1 tag, when checks source code not seo friendly display script

i think need server side php code, have tried using

<h1><?php echo $pagetitle ?></h1>

but above not displaying value. leading blank h1 tags

can suggest , advise pls effectively

thanks

try this:

html:

<h1 id="pagetitle"></h1>

javascript:

document.getelementbyid('pagetitle').innerhtml = document.title;

if want script inline:

<h1 id="pagetitle"></h1> <script> document.getelementbyid('pagetitle').innerhtml = document.title; </script>

php joomla

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -