adding <script> a wordpress en el elemento <head>
Estoy intentando insertar este código:
<script type="text/javascript">
some Javascript codes comes here
</script>
to Wordpress '<head></head>
sección en la parte frontal y en el panel de administración
Por ejemplo, Joomla! 1.6 tiene una API que permite esto:
$doc =& JFactory::getDocument();
$doc->addCustomTag($headTag);
Necesito agregar diferentes cosas para diferentes páginas. Por ejemplo
Página Necesito agregar
<link rel="alternate" type="application/rss+xml" title="feed title" href="feed url" />
Para unas pocas páginas
Página Necesito agregar
<script type=\"text/javascript\" src=\"" . LIVE_SITE .
"/wp-content/plugins/jobs/lknlibrary/js/ajax.js\"></script>
<script type=\"text/javascript\">
var ajax = new sack();
var currentClientID=false;
function getClientData()
{
var clientId = document.getElementById('db_country_id').value.replace(/[^0-9]/g,'');
ajax.requestFile = '" .BASE_PATH . "/wp-content/plugins/jobs/com_jobs_admin/tasks/get_location_data.php?task=get_location_data&name=db_parent_id&getClientId='+clientId; // Specifying which file to get
ajax.onCompletion = showClientData; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
}
function showClientData()
{
clearJS = ajax.response;
var strTagStrippedText = clearJS.replace(/(<\s*\/?\s*)div(\s*([^>]*)?\s*>)/gi ,'');
document.getElementById('locationsDiv').innerHTML=strTagStrippedText ;
}
function initFormEvents()
{
if (document.getElementById('db_country_id')){
document.getElementById('db_country_id').onchange = getClientData;
document.getElementById('db_country_id').focus();
}
}
window.onload = initFormEvents;
</script>
para unas pocas páginas
Página Necesito agregar
<link rel="stylesheet" type="text/css" href="/wordpress/wp-content/plugins/jobs/lknlibrary/js/tabs/tab.webfx.css" />
para unas pocas páginas
Tengo más de 70 páginas en el panel de administración como las anteriores.
Tratar de administrar el encabezado de WordPress con el ejemplo es un poco difícil.