link header to homepage (for wp multisite)

A few issues- php tags are for interpolating between php/html, they can’t go within php statements. Also, the single quotes in bloginfo are closing your string, which is generating the error. Lastly, bloginfo will echo its value, which can’t go within an echo statement, you need to use get_bloginfo instead, or simpler, just use home_url(): … Read more

Detect what page was linked-from

To encode the URLs on the source page, in this case ‘home’: function append_query_string( $url, $post, $leavename ) { if ( $post->post_type == ‘post’ ) { $url = add_query_arg( ‘source’, ‘home’, $url ); } return $url; } add_filter( ‘post_link’, ‘append_query_string’, 10, 3 ); This adds ?source=home to the end of post link URLs on the … Read more