Restrict Access to Logged-In Users Page Template

This could be done in a number of ways. Please refer to the codex for further info on template hierarchy, the wordpress loop and the ‘get_template_part()’ function. The page.php is for dispalying every page. You should copy and rename it to page-restricted.php. From the original page.php, remove this part – /* Template Name: Restrict Access*/. … Read more

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