Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION "meta id" OR "meta description"
#1
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.
Reply
#2
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 ... > ?


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#3
(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
Reply
#4
I dont have a life Big Grin  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.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#5
(2024-01-28, 00:58:07)islander Wrote: I dont have a life Big Grin  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.
Reply
#6
(2024-01-28, 01:05:07)LogicPHP Wrote:
(2024-01-28, 00:58:07)islander Wrote: I dont have a life Big Grin  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.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#7
(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 Big Grin  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.
Reply
#8
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.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#9
(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.
Reply
#10
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.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#11
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.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply




Users browsing this thread: 1 Guest(s)