Inserting article:tags meta in html head-element, using get tags, no wp_head

Okay, so after some more tinkering, I found another solution. This one works with or without the loop. So adding it in the template file or your single.php is fine, in the <head> of the HTML. <?php $tags = get_the_tags($post->ID); ?> <?php foreach($tags as $tag) : ?> <meta property=”article:tag” content=”<?php print_r($tag->name);?>” /> <?php endforeach; ?> … Read more

How to display the contents of URL1 when user visits URL2

Have WordPress (which creates the web server responses) respond with a redirect (via a call to wp_redirect()). Put as the first thing in header.php global $post; if( needs_replacement( $post ) ) { $from_url = create_url( $post ); wp_redirect( $from_url ); exit(0); } require_once( get_template_directory() . ‘/page.php’ ); ?> (Note that you have to this first … Read more

Set page template automatically according to parent slug

You can override the hierarchy and load a specific page template via the page_template filter. The fastest way is to identify the parent page by ID: function wpd_page_template_filter( $template ){ $page = get_queried_object(); if( 42 == $page->post_parent ){ // en page has ID of 42 $template = locate_template( ‘page-en.php’ ); } return $template; } add_filter( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)