How to make WordPress urls matching static html urls

It looks like every “old” URL is a bit different from each other so you should manually create permanent redirects (HTTP 301) for each URL. I recommend using either Redirects (very simple and intuitive) or Safe Redirect Manager (more advanced features) plugins.

Creating customized php files in theme folder

Problem#1: You can create a customized php file for your page using a Page Template Page Templates WordPress looks for template files in the following order: Page Template — If the page has a custom template assigned, WordPress looks for that file and, if found, uses it. page-{slug}.php — If no custom template has been … Read more

how to load posts to a custom post template after using template_redirect or template_include

here is the full code to force change theme by a reserved wordpress parameter add_action( ‘pre_get_posts’, ‘my_pre_get_posts’ ); function my_pre_get_posts($wp_query) { global $wpdb; // Confirm request is main query if(!$wp_query->is_main_query()) { return; } // Get post name from query $post_name = $wp_query->get(‘pagename’); // Get post type from database $post_type = $wpdb->get_var( $wpdb->prepare( ‘SELECT post_type FROM … Read more

Call featured image url

the_post_thumbnail() is highest level function for it, which will output complete HTML. If you need some lower level parts, digging deeper are nested: get_the_post_thumbnail() wp_get_attachment_image() wp_get_attachment_image_src()

TinyMCE Javascript URL Question

I think the best way is to use the before_wp_tiny_mce() hook. Then, you can define the url in PHP; and pass it to the page so it is available to TinyMCE. function sgp_before_wp_tiny_mce() { ?> <script type=”text/javscript”> var sgp_plugin_url = “<?php echo plugins_url(‘shortcode_generator_popup.php’, __FILE__); ?>”; </script> <?php } add_action(‘before_wp_tiny_mce’, ‘sgp_before_wp_tiny_mce’); You may need to change … Read more

Double slash in the_terms URL

First Assumption: That an extra slash was being added for some reason To see what was going on, I wanted to see what was going on in the array. When I print_r() the array I get the following: Array ( [10] => stdClass Object ( [term_id] => 10 [name] => Mozilla [slug] => mozilla [term_group] … Read more

Blog post – single.php url

This is normal. You probably have your Permalinks set to “Post Name”. You can change your Permalinks to “Custom Structure” and put ‘/news’ in there before the post title, so the “Custom Structure” field would look like this: /news/%postname%/ That should do it.

Redirect Image Url to a page via htaccess

You’ll need to add a rewrite rule to your .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} !/wp-admin/ [NC] RewriteRule ^wp-content/uploads/.+?\.(jpe?g|png|gif|svg)$ /my-page [R=301,L] </IfModule> Add this after anything added by WordPress. You’ll need to replace /my-page with the slug of the page you’d like to redirect to.

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