![]() |
append after <head> in all templates?
This turned out to be a global replace that is very handy if you know how to use it, you can find the solution begining in post 18(for vb4) and 20 (for vb3)
So I know if I was going to add something after <head> to one template I could do it something like: Code:
$find = '<head>'; Tried this and a few other combinations with no luck: Code:
$find = '<head>'; |
Why not just add it with a template hook. There are a couple in head or its sub templates.
|
because im trying to change <head> to lol, just learning experiance
|
What exactly are you trying to add to <head>? Maybe there's another way to do it instead of replacing it.
|
If I recall correctly, what I have done in vB 3.8.9 to add something to pages is append it to either $spacer_open or $spacer_close. :)
|
Quote:
this is just an example not what I'm doing, but say I wanted to replace Code:
<head> Code:
<head class="someClass"> so its looking like if I want to do something like this I'll have to create a replace for every template Code:
$find = '<head>'; |
What do you get by adding CSS to the head element?
|
that is not what im doing was just an example lol
|
If it really turns out to be difficult to do this, you can write some native JavaScript to do this.
http://stackoverflow.com/questions/2...o-the-head-tag |
the end result will actually be for spiders, and i dont believe spiders see execute js
--------------- Added [DATE]1460644385[/DATE] at [TIME]1460644385[/TIME] --------------- why does this method not work? Code:
<head> = str_replace('head', 'head class="test"', <head>); |
All times are GMT. The time now is 03:55 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|