Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Montezuma Head Not work meta tags (http://forum.bytesforall.com/showthread.php?t=19167)

darkcrizt Dec 20, 2012 07:50 AM

[solved]Montezuma Head Not work meta tags
 
1 Attachment(s)
Hi I tried to add the meta tags to the header of wordpress, the problem with that is I am trying to define the description with the extract of the entry, checking the source code does not show me anything leaving the field blank.

There will be some solution to this, I have tried several methods and the result is the same as testing with different codes show here.
HTML Code:

<meta name="description" content="<?php bfa_excerpt( 40, ' ...' ); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="<?php the_excerpt(); ?>" />
<meta itemprop="url" content="<?php the_permalink(); ?>" />
<meta itemprop="name" content="<?php the_title(); ?>" />
<meta itemprop="description" content="<?php bfa_excerpt(40, 'text???' ); ?>" />
<meta name="twitter:card" value="summary" />
<meta name="twitter:url" value="<?php the_permalink(); ?>" />
<meta name="twitter:title" value="<?php the_title(); ?>" />
<meta name="twitter:description" value="<?php bfa_excerpt(); ?>" />

I have had other problems in a matter of inserting code to the topic, I realize that the subject is very limited with php to limit to a few functions.
It would be good that this limitation of the subject removed to insert php code freely.

juggledad Dec 20, 2012 08:58 AM

Quote:

It would be good that this limitation of the subject removed to insert php code freely.
you will have to talk to the WordPress theme review team about this. They have restricted the use of the 'eval()' function from themes. With the Atahualpa theme you use to be able to put php in almost any option, but then the review team rejected the use of the 'eval()' and that feature had to be removed from the theme. I don't think their reasoning was very plausable, but Flynn (the developer of Atahualpa and Montezuma) had to remove it or the theme would be rejected.

Quote:

I tried to add the meta tags to the header of wordpress, the problem with that is I am trying to define the description with the extract of the entry
1) Where did you add the tags? Exactly.
2) what do you mean you trying to 'extract of the entry'?

darkcrizt Dec 21, 2012 01:01 AM

I think I got it wrong, never speak of eval in theme options shows off a gallery of its functions limited to 60 even giving the notice
"Note: This is a limited set of PHP functions. You can not use arbitrary PHP code. You can only use the functions listed here are That. You can not use PHP Also conditions or loops etc ... Just what you see listed here. "

You can not use arbitrary PHP code, is what I meant, it would be nice to be able to use arbitrary PHP code, but that's another thing.

A question to find a solution and to find some function or php code to allow me to show what I wanted to find him still
PHP Code:

// Meta desc.
function create_meta_desc() {
    global 
$post;
if (!
is_single()) { return; }
    
$meta strip_tags($post->post_content);
    
$meta strip_shortcodes($post->post_content);
    
$meta str_replace(array("\n""\r""\t"), ' '$meta);
    
$meta substr($meta0120);
    echo 
"<meta name='description' content='$meta' />";
    echo 
"<meta property='og:description' content='$meta' />";
    echo 
"<meta itemprop='description' content='$meta' />";
    echo 
"<meta name='twitter:description' value='$meta' />";


I hope might help others if they have the same need for me to show a description of the entries tagged goal.

I hope the creator of the note issue such limitation to insert arbitrary PHP code.
Remove many headaches and the topic would be more compatible with more plugins that require inserting your call on the issue with php code.


All times are GMT -6. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.