Choose template depending on URL

One post cannot (and should not) have two single post URLs. All you can change is the archive view, the list of posts. If /gallery/ and /extra/ are post of the post type page, use a custom page template for those. Update Create two endpoints gallery and extra for the root (EP_ROOT) (another example). The … Read more

Why are all pages redirecting to homepage when using custom permalinks?

Here’s my .htaccess … there are a few differences, perhaps it might be worth comparing: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ – [L] RewriteRule . index.php [L] </IfModule> Also, I assume you … Read more

Hyperlinking images on posts to permalink

If they are featured images or post Thumbnails U can add this code in functions.php to link them add_filter( ‘post_thumbnail_html’, ‘my_post_image_html’, 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html=”<a href=”” . get_permalink( $post_id ) . ‘” title=”‘ . esc_attr( get_post_field( ‘post_title’, $post_id ) ) . ‘”>’ . $html . ‘</a>’; return $html; … Read more

My wordpress site must be being affected by outside sources [duplicate]

Sounds like you got a recycled domain and/or your hosting configuration is not configured right. Also by running a traceroute you have multiple domains set for both http://www.kgstiles.com & http://www.kgstiles.com/pureplantessentials This is a pretty common scenario but can sometimes cause some domain issues. I wouldn’t rule you the possibility of some external source affecting your … Read more

Performance and styles not working fine after changing permalink structure

Your .htaccess should not be modified on the WordPress part, so it should always be: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress It looks like if you have your WordPress install in a Subdirectory of … Read more

Routing ‘fake’ sub sub posts

You will need to whitelist a new query_var: function add_query_vars($aVars) { $aVars[] = “subpage”; // represents the name of the product category as shown in the URL return $aVars; } // hook add_query_vars function into query_vars add_filter(‘query_vars’, ‘add_query_vars’); You will need then need a rewrite rule to match your URL and pass in the correct … Read more

Appending a variable to RSS link url

add the following to your functions.php file: add_filter(‘feed_link’,’my_site_feed’, 10, 2); function my_site_feed($url, $feed_type ){ $user = my_get_the_username(); //this function should return the username. return add_query_arg( array(‘user’ => $user ), $url ); } And get your rss feed url using: echo get_bloginfo(‘rss2_url’); or bloginfo(‘rss2_url’);

Styles are not loading when changing permalink to %postname%?

What are you typing in the src=”https://wordpress.stackexchange.com/questions/82463/xxxxxx”? Do you have the absolute path or relative path to your style? If your not loading the CSS from your functions.php with wp_enqueue_style you should load it like this in your header to always get the correct URL to the file: <link rel=”stylesheet” type=”text/css” href=”https://wordpress.stackexchange.com/questions/82463/<?php echo get_stylesheet_uri(); ?>”> … Read more