This is not much of a mod, but since we've had two support threads in the last week, I think having it here for future reference will be a good idea.
Find this around line 214:
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">";
Replace it with this:
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">
<meta name="description" content="description here">
<meta name="keywords" content="your keywords here">";
You can add all the meta tags you want to right here. The important thing to remember is to escape any quotes that appear in the html by putting a forward slash in front of them.
is there a way to do this so that you can put a variable on all the pages or something so that you can assign different pages with different meta tags?
is there a way to do this so that you can put a variable on all the pages or something so that you can assign different pages with different meta tags?
You could possibly do all that in the header.php; although it might not be the best option, because it'd have to re-parse every reload...
For one page:
<meta name="description" content="" . ($current == "about" ? "this is the about page" : "the default description") . "">
<meta name="keywords" content="" . ($current == "about" ? "about us, lala, test" : "default, keywords") . "">";
Where $current (I think that's the variable name) is the "name" of the page.
For "lots" of pages:
<?php
if ($current) {
switch ($current) {
case "help":
$mkeywords = "help, faq guide";
$mdescription = "the help page";
break;
case "privacy":
$mkeywords = "pp, policy, privacy";
$mdescription = "the privacy policy page";
break;
default:
$mkeywords = "the, default, keywords";
$mdescription = "lala";
break;
}
}
?>
(etc)
And then you can use:
<meta name="description" content="{$mdescription}">
<meta name="keywords" content="{$mkeywords}">";
archive:
site:
Available for skin/mod commission! 🙂
What's the problem?
archive:
site:
Available for skin/mod commission! 🙂
Do we do meta tags with spaces or commas?
"Efiction, fan-fiction, fanfic" or "Efiction fanfiction fanfic"?
eFiction:3.5.1
Latest Patche(s):Yes
bridged?:No
modified?:Yes.
PHP:2.11.9.4
MySQL:5.0.32
Commas. 😀
archive:
site:
Available for skin/mod commission! 🙂
Is this still the same for v3? When I went to find the line at 214 it is slightly diff. I know it's probably okay to replace it but wanted to make sure... the line in the v3 header.php is ...
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">
It looks the same but it goes right into the print coding and I don't want to be interrupting a command there if it's not a closed code. I noticed it was missing the ; at the end when comparing it to what was searched for. May sound stupid of me to ask it but just dont want to do even a small error if I didn't have to.
Thanks,
Is this still the same for v3? When I went to find the line at 214 it is slightly diff. I know it's probably okay to replace it but wanted to make sure... the line in the v3 header.php is ...
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">It looks the same but it goes right into the print coding and I don't want to be interrupting a command there if it's not a closed code. I noticed it was missing the ; at the end when comparing it to what was searched for. May sound stupid of me to ask it but just dont want to do even a small error if I didn't have to.
Thanks,
et="._C should be et="._C
I am rebuilding efiction! Join us on irc! #efiction at
No, that's right.
_CHARSET is a constant.
archive:
site:
Available for skin/mod commission! 🙂
my header.php
echo _DOCTYPE."<html><head>";
$headerSent = true;
if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan";
if(isset($metaDesc)) echo "<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">
<meta name="description" content="INSERT DESCRIPTION">
<meta name="keywords" content="INSERT,KEYWORDS">";
if(!isset($_GET['action']) || $_GET['action'] != "printable") {
echo "<script language="javascript" type="text/javascript" src="""._BASEDIR."includes/javascript.js"></script>"
<link rel="alternate" type="application/rss+xml" title="$sitename RSS Feed" href="""._BASEDIR."rss.php">";[/code"]
I am rebuilding efiction! Join us on irc! #efiction at
www.mibbit.com Instructions for irc :D Alpha released!
I replaced
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">";
with
Code:
<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."">
<meta name="description" content="description here">
<meta name="keywords" content="your keywords here">";
I put in the site descriiption and keywords but I still got nowhere. Nothing changed. When I put in the keywords in google it doesn't work. And the description still doesn't show up. Did I do something wrong?
Dana
The changes won't be immediate for a search engine because they have to come by and crawl again. The way to check it immediately would be to view the source on your page and make sure it's appearing as it should there, so that when they do come by again it's right.
Dana, the meta tags aren't going to make google come by your site any faster, like Lyndsie said. They just make it easier for google know what your site is all about. Also, your description will show up under the name of your site in search engines. That is more likely to entice people to visit your site than letting google pick out your description.
You should also take a look at google webmaster tools: https://www.google.com/accounts/ServiceLogin?service=sitemaps&passive=true&nui=1&continue=https%3A%2F%2Fwww.google.com%2Fwebmasters%2Ftools%2F&followup=https%3A%2F%2Fwww.google.com%2Fwebmasters%2Ftools%2F&hl=en
*Disclaimer: It is my understanding that google and other search engines don't use keywords anymore to index a site. I actually heard a google employee (at that time) confirm this at a conference so I'm inclined to think it's true. Apparently, a lot of sites fill them with spam. I guess it doesn't hurt to have them, even if it doesn't help.
Oh I know that it won't make the site come up faster. I just wanted the description to come up under the link since right now people see a disclaimer under the link when using google or any search engine. But the description isn't coming up. Am I doing something wrong? Why isn't it working for me?
Dana
Dana, I think you're a little confused. No one's talking about how to make your page load faster or anything like that. What we're talking about is that search engines are in effect just really big databases, though they happened to be updated frequently. They get updated by using their crawler bots, which are computers that go out and view tons and tons of pages (through magical and secret means that they don't like to reveal). Also, the way things are ranked is also somewhat secret. So what happens is that once you change your website, the changes won't appear automatically at a search engine. The crawlers have to come by and crawl it again, to get the updated data.
With Google, one way that your site gets a higher ranking, and gets crawled more frequently, is to have a lot of links to your site. The more people link your site, the more opportunities there are to get to it on the web, and the more importance it gets assigned. With a new site, you can see why this would not be the case.
My boyfriend (who works for Google) says he thinks that you can submit your site to be crawled through the Webmaster Tools, which Carissa just linked you to. He's mentioned them before as being useful, so I would definitely take a look. : ) Other search engines probably have similar resources.
