![]() |
#1 |
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
Question about XHTML and meta tag
This is my sample page:
code: My question is: Is it possible to show any of the meta tags info into the body of the page? For example show "Date" * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
![]() |
![]() |
![]() |
#2 | |
Just Strolling By
(Major Dude) Join Date: Aug 2002
Location: A Long Winding Road.....
Posts: 3,250
|
Quote:
![]() Music is Life, Love and Happiness :|: Life is Music. Serren - 1985 - 2005 Religion? Religion is a Blasphemy against humanity - From the film What the Bleep do we know siggy link So stumbling? whats it all about |
|
![]() |
![]() |
![]() |
#3 |
Banned
Join Date: Jun 2004
Location: Oregon
Posts: 11,002
|
|
![]() |
![]() |
![]() |
#4 |
Balled and Chained
Alumni Join Date: Jun 2000
Posts: 5,238
|
"My heart hates uggos." –J.D. |
![]() |
![]() |
![]() |
#6 |
[STILL a retard!]
Join Date: Apr 2002
Location: Bristol, UK
Posts: 1,168
|
code: |
![]() |
![]() |
![]() |
#7 |
Banned
Join Date: Jun 2004
Location: Oregon
Posts: 11,002
|
Output the date metadata for the current page:
<p>The meta date is:</p><?php $tags = get_meta_tags("http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]); echo $tags['date'];?> |
![]() |
![]() |
![]() |
#8 |
not fucked, not quite.
(Forum King) |
|
![]() |
![]() |
![]() |
#9 | |
[STILL a retard!]
Join Date: Apr 2002
Location: Bristol, UK
Posts: 1,168
|
Quote:
You may as well just use php to define some vars before you output the page, then reference them as you spit it out. code: |
|
![]() |
![]() |
![]() |
#10 |
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
@QOAL: helps
![]() * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
![]() |
![]() |
![]() |
#11 | |
Banned
Join Date: Jun 2004
Location: Oregon
Posts: 11,002
|
Quote:
Put this in the body of a wordpress ( d r u p a l, joomla etc.)page: <strong><p>Post date:</p><?php $tags = get_meta_tags("http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]); echo $tags['date'];?><br> <p>Post author:</p><?php $tags = get_meta_tags("http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]); echo $tags['author'];?><br></strong> Post date:06.06.2013 14:09:08 Post author:rockouthippie |
|
![]() |
![]() |
![]() |
#12 |
[STILL a retard!]
Join Date: Apr 2002
Location: Bristol, UK
Posts: 1,168
|
I'm just dealing with the exact problem that Joel posted, nothing else. I'm not concerned about other websites.
Most CMS type sites have an API where you can fetch this information. (For wordpress: http://codex.wordpress.org/Function_Reference/) And if it's not available then just go in and extend stuff (cleanly) so you can get it. The cost of doing this is smaller than fetching and parsing the page, especially if the requested page is not cached. You're also making two requests with that example, so it'll be even slower. Not that it matters because you are creating an infinite loop! The page that is being generated is fetching itself (to get the meta data) which in turn is... fetching itself... Try it yourself by using Joel's example as a base page. |
![]() |
![]() |
![]() |
#13 | |
Banned
Join Date: Jun 2004
Location: Oregon
Posts: 11,002
|
Quote:
OK... so get_post_meta as a Wordpress function. getMetaData in Joomla. You've got to gyrate a little to get it out of D r u p a l. |
|
![]() |
![]() |
![]() |
#14 |
Junior Member
|
w3schools also has some good links
Simplicity in all things. |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|