Meta tags – add property to schema_article_author (schema_metatag)

I want to add the property honorificSuffix to the authors of an article.
Since the author no group Regarding schema_metatag definitions, I can not add the field as shown above schema_article_example Module.

How can I add the property as a subkey of the article_author field?
I do not want to do any patches on that SchemaPersonOrgTrait or SchemaPersonOrgBase to inherit this property into the schema metadata.

This should be possible through a custom tag – as shown in the example module.

7 – Add a meta tag to a hook_menu page that returns a json output

I have a custom page that I created with hook_menu

$items('list') = array(
    'page callback' => 'page_callback',
    'type' => MENU_CALLBACK,
    'access arguments' => array('access content'),
);

I'd like to add the meta tag to the header of this page to prevent indexing. I tried the following code.

function page_callback() {
  $arr = array('test1', 'test2');

  $element = array(
    '#tag' => 'meta',
    '#attributes' => array(
      'name' => 'robots',
      'content' => 'noindex',
    ),
  );
  drupal_add_html_head($element, 'test');

  // Return the list in json format.
  drupal_json_output($arr);
}

But when I inspect the page, I do not see anything in the header of the page.

When I try to return a string instead of the json, I can see this meta tag.

function page_callback() {
      $arr = array('test1', 'test2');

      $element = array(
        '#tag' => 'meta',
        '#attributes' => array(
          'name' => 'robots',
          'content' => 'noindex',
        ),
      );
      drupal_add_html_head($element, 'test');

      // Return the list in json format.
      drupal_json_output('something');
    }

How can I add it to the page that json outputs?

loop – Meta Query Compare for IDs larger than the specific ID

I only want to retrieve all posts that have a higher value than a specified post id

'meta_query' => array(
    'relation' => 'AND',
    array(
        'key' => 'rid',
        'value' => $rid,
        'compare' => '=',
        'type' => 'numeric',
    ),
    array(
        'key'     => ID,
        'value'   => $last_id,
        'compare' => '>',
        'type'    => 'numeric'
    ),
),

So if $ last_id is "350", I want to retrieve all posts higher than 350

Do onpage SEO optimization, meta description, speed optimization, and sitemap for $ 40

Do onpage SEO optimization, meta description, speed optimization and sitemap

On page SEO optimization is the process of optimizing every single web page on your website to rank higher on the Search Engine Results Pages (SERPS). This White Hat SEO Optimization Service can increase the Google ranking of your website or blog by 90% or more.

Our on-site optimization services include:

  • Free: Website SEO Audit Report
  • Long tail, LSI & Focused Keywords Optimization
  • competitors Back links analysis
  • Install and configure WordPress Yoast SEO Plugin
  • compellingly Meta description, titles and effective tags
  • headlines (H₁, H₂, H₃) optimization
  • Images alt tags and speed optimization
  • XML sitemap / robots txt file Creation & Submission
  • Google Webmaster Tools verification
  • Select the Redirect broken links & broken links check box to the home page or parent page
  • Social media meta tags, Hyperlink and anchor text optimization
  • Index all pages on Google, Bing and Yahoo
  • Search engine friendly titles, URLs and website structure

Why we?

  • 100% customer satisfaction and money back guarantee.
  • WordPress, Wix, Shopify and Amazon specialists

If you have any questions, please do not hesitate to contact us.

, (tagsToTranslate) onpage (t) seo (t) wordpres (t) siteseo (t) websites

WP_Query on meta returns featured posts (mismatch meta query)

When migrating a site to WordPress, old URLs should be redirected

So I've created a function that intercepts 404 and looks for a meta value that matches the number in the URL that should be redirected.

It worked like a charm until a user posted a new article and made it sticky. This query returned the sticky post and ignored the meta query

I have tried many things to correct that which did not work that way 'suppress_filters' => true

in case of emergancy 'post__not_in' => get_option( 'sticky_posts' ) did the trick, but that's not the way. (If this post I wanted was sticky, he would not find it!)

How can I then create a WP_Query that receives a post via meta-query and does not insert sticky posts?

add_action( 'template_redirect', 'wpd_do_stuff_on_404' );
function wpd_do_stuff_on_404(){
    if( is_404() ){

        $url = $_SERVER('REQUEST_URI');

        if (preg_match('//(d+)-(^/)*$/', $url, $matches) ) {
            // looks like a dc post, lets try to find a post using dc_post_id
            $dc_post_id = intval($matches(1));
            $args = array(
               'meta_query' => array(
                   array(
                       'key' => 'dc_post_id',
                       'value' => '' . $dc_post_id,
                       'compare' => '=',
                   )
               ),
               'suppress_filters' => true,
               'posts_per_page' => 1,
            );

            $q = new WP_Query($args);

            if ( $q->post_count == 1 && $q->max_num_pages == 1 ) {
                wp_redirect( get_permalink( $q->posts('0')->ID ), 301 );
                exit;
            }
        }
    }
}