Posts: 12
Threads: 4
Joined: Jan 2024
I have in Meta description, the following text: "Meta description example".
I want to extract the information from the "Meta description" and display it automatically, using the syntax:
<meta id="schema_description" itemprop="description" content="<?php function_exists('get_i18n_header') ? get_i18n_header(true,array('generator')) : get_header(); ?>">
But the extracted information appears as in the example below:
<meta id="schema_description" itemprop="description" content="<meta name="description" content="Meta description example" />
Does anyone know how to write this code syntax correctly?
How can I make this code, so that in the "content" section I can insert the existing information in the Meta description, only.
Posts: 328
Threads: 5
Joined: May 2012
2024-01-28, 00:09:50
(This post was last modified: 2024-01-28, 00:10:12 by islander.)
Did you try just using only:
PHP Code: <?php function_exists('get_i18n_header') ? get_i18n_header(true,array('generator')) : get_header(); ?>
without it being wrapped in <meta bla bla ... > ?
Posts: 12
Threads: 4
Joined: Jan 2024
2024-01-28, 00:39:10
(This post was last modified: 2024-01-28, 00:41:06 by LogicPHP.)
(2024-01-28, 00:09:50)islander Wrote: Did you try just using only:
PHP Code: <?php function_exists('get_i18n_header') ? get_i18n_header(true,array('generator')) : get_header(); ?>
without it being wrapped in <meta bla bla ... > ?
Hi Islander. You are the main supporter in the further development of GetSimple CMS, it seems.
What you proposed I use, at the moment, but I want to adapt the existing data extraction in "Meta descriptions" and implement it in "meta id". This I want to adapt, something like in the example below.
<meta id="schema_description" itemprop="description" content="Meta description example.">
i need
<meta id="schema_description" itemprop="description" content="insert PHP code">
change "insert PHP code" with the correct meta description text
Posts: 328
Threads: 5
Joined: May 2012
2024-01-28, 00:58:07
(This post was last modified: 2024-01-28, 00:59:43 by islander.)
I dont have a life try to help when I can.
I will try to take a look at this this weekend. I dont use your method, so I will need to play with it a bit.
For most of my projects I use BetterSEO.
Posts: 12
Threads: 4
Joined: Jan 2024
(2024-01-28, 00:58:07)islander Wrote: I dont have a life try to help when I can.
I will try to take a look at this this weekend. I dont use your method, so I will need to play with it a bit.
For most of my projects I use BetterSEO.
I also use Better SEO, but it is not useful. I can say that what this plugin does, I can write manually in the hedear.php file, and still much more complex. I don't see it to be useful. It is very limited in entering the necessary SEO code. It has only 5 functions and those are useless. I don't see it being useful.
If you think you have time to correct the necessary "meta ID" code please come back with a reply.
Posts: 328
Threads: 5
Joined: May 2012
(2024-01-28, 01:05:07)LogicPHP Wrote: (2024-01-28, 00:58:07)islander Wrote: I dont have a life try to help when I can.
I will try to take a look at this this weekend. I dont use your method, so I will need to play with it a bit.
For most of my projects I use BetterSEO.
I also use Better SEO, but it is not useful. I can say that what this plugin does, I can write manually in the hedear.php file, and still much more complex. I don't see it to be useful. It is very limited in entering the necessary SEO code. It has only 5 functions and those are useless. I don't see it being useful.
If you think you have time to correct the necessary "meta ID" code please come back with a reply.
Yes, of course it can be added manually, but for me its easier adding on line than doing it all by hand.
What other necessary SEO code is it missing? Maybe this can be updated.
Posts: 12
Threads: 4
Joined: Jan 2024
(2024-01-28, 01:48:09)islander Wrote: (2024-01-28, 01:05:07)LogicPHP Wrote: (2024-01-28, 00:58:07)islander Wrote: I dont have a life try to help when I can.
I will try to take a look at this this weekend. I dont use your method, so I will need to play with it a bit.
For most of my projects I use BetterSEO.
I also use Better SEO, but it is not useful. I can say that what this plugin does, I can write manually in the hedear.php file, and still much more complex. I don't see it to be useful. It is very limited in entering the necessary SEO code. It has only 5 functions and those are useless. I don't see it being useful.
If you think you have time to correct the necessary "meta ID" code please come back with a reply.
Yes, of course it can be added manually, but for me its easier adding on line than doing it all by hand.
What other necessary SEO code is it missing? Maybe this can be updated.
Many meta tags are missing, without which SEO indexing cannot be done properly. Missing these meta tags makes it difficult to get the results you want. I think it is more useful to write them manually, than to use a plugin, useless, or with reduced possibilities.
Tags like <meta charset="UTF-8">
<meta name="description" content="GetSimple CS">
<meta name="keywords" content="GetSimple CMS, Get Simple, cms, etc">
<meta name="author" content="GetSimple CMS">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> and many, many others in this category are very important.
Similarly, the meta id information, so necessary for structured data, is missing and very important. Better SEO I think has too big a name for its real possibilities.
Posts: 328
Threads: 5
Joined: May 2012
I would suggest you give it another try, as I dont think you looked at what the plugin outputs?
BetterSEO's name is just meant to say that it is better than the default GS seo.
All tags that you mentioned are given by BetterSEO, with the exception of "author". It adds "copyright" instead.
And as modern search engines no longer use keywords, this has been omitted.
"description" is added using the meta field, and if left empty, it will grab text from the page content field.
It also adds "robots", "last-modified", "canonical" as well as several optional sections.
Posts: 12
Threads: 4
Joined: Jan 2024
(2024-01-28, 20:06:44)islander Wrote: I would suggest you give it another try, as I dont think you looked at what the plugin outputs?
BetterSEO's name is just meant to say that it is better than the default GS seo.
All tags that you mentioned are given by BetterSEO, with the exception of "author". It adds "copyright" instead.
And as modern search engines no longer use keywords, this has been omitted.
"description" is added using the meta field, and if left empty, it will grab text from the page content field.
It also adds "robots", "last-modified", "canonical" as well as several optional sections.
I don't want to bother anyone at all, but Better SEO is almost ineffective on the whole optimization. It does not even realize the primary options, not to mention the advanced optimization needs. I respect you for the work done in the development of this plugin, but it can still be improved.
I didn't know why it doesn't display the information in the "Meta description" box of GetSimple CMS in the search engines, and actually displays the information in the web page, now I found out, and because it caused me so much inconvenience, I just disabled it.
Posts: 328
Threads: 5
Joined: May 2012
2024-01-28, 21:52:56
(This post was last modified: 2024-01-28, 21:53:56 by islander.)
Let me see if I can help you find a solution to your problems...
I understand that it is rare to find a perfect solution, as one size does not fit all.
Also, language barriers can get in the way. I speak English and Spanish, for all else I use google translate.
Let me see if I can give you an example of what the plugin does, or maybe a few tips to personalize it for your own needs...
File: /theme/ResponsiveCE/header.inc.php
I will be modifying the <head> section from:
Code: <head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php get_page_clean_title(); ?> | <?php get_site_name(); ?></title>
<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/css/pico.min.css">
<?php echo ($bootstrap !== 'yes' ? '' : '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap-grid.min.css" integrity="sha512-JQksK36WdRekVrvdxNyV3B0Q1huqbTkIQNbz1dlcFVgNynEMRl0F8OSqOGdVppLUDIvsOejhr/W5L3G/b3J+8w==" crossorigin="anonymous" referrerpolicy="no-referrer" />'); ?>
<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/css/style.css?v=<?php echo rand(); ?>">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<?php get_header(); ?>
</head>
which gives an output of:
Code: <head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome to GetSimple! | MA5</title>
<link rel="stylesheet" type="text/css" href="http://localhost/ma5/theme/ResponsiveCE/css/pico.min.css">
<link rel="stylesheet" type="text/css" href="http://localhost/ma5/theme/ResponsiveCE/css/style.css?v=722174688">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<meta name="keywords" content="getsimple, easy, content management system" />
<link rel="canonical" href="http://localhost/ma5/" />
</head>
To the edited <head>:
Code: <head>
<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/css/pico.min.css">
<?php echo ($bootstrap !== 'yes' ? '' : '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap-grid.min.css" integrity="sha512-JQksK36WdRekVrvdxNyV3B0Q1huqbTkIQNbz1dlcFVgNynEMRl0F8OSqOGdVppLUDIvsOejhr/W5L3G/b3J+8w==" crossorigin="anonymous" referrerpolicy="no-referrer" />'); ?>
<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/css/style.css?v=<?php echo rand(); ?>">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<?php get_seoheader(); ?>
</head>
• Note that meta data was removed and " get_header" was changed to " get_seoheader".
Even with zero options in BetterSEO activated, this gives an output of:
Code: <head>
<link rel="stylesheet" type="text/css" href="http://localhost/ma5/theme/ResponsiveCE/css/pico.min.css">
<link rel="stylesheet" type="text/css" href="http://localhost/ma5/theme/ResponsiveCE/css/style.css?v=1556432431">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<!-- Basic Header Needs
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, shrink-to-fit=no" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<base href="http://localhost/ma5/">
<title>MA5 | Welcome to GetSimple!</title>
<meta name="description" content="Thank you for using GetSimple CMS. This is your homepage, so please change this text to be what you want. GetSimple CMS Documentation How to Create a...">
<meta name="robots" content="index, follow">
<meta name="copyright" content="MA5">
<meta http-equiv="last-modified" content="Wed, 17 Jan 2024 19:13:08 GMT">
<link rel="canonical" href="http://localhost/ma5/">
</head>
If you would prefer to have author instead of copyright, you can manually edit the plugin.
Likewise, if you do require keywords, this too can be manually added.
The example output above was with the page "Meta Description" field left blank. But, if you do add custom info here, for example "bla bla bla", the output in header would change to:
Code: <meta name="description" content="bla bla bla">
It is not a bother, maybe just a communication error, and I am possibly not understanding your needs correctly.
Posts: 328
Threads: 5
Joined: May 2012
If you still are not happy with that plugin or it does not meet your needs, describe what could be added or changed.
Alternatively, if you are just trying to manually add info into your header, you may need other tags that are not added by default, but can be found in the wiki.
Such as:
<?php get_page_meta_keywords(); ?>
<?php get_page_meta_desc(); ?>
etc.
|