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.

Exclude image url from search query

try this to exclude images from search. Add code to your functions.php: // Exclude images from search results – WordPress add_action( ‘init’, ‘exclude_images_from_search_results’ ); function exclude_images_from_search_results() { global $wp_post_types; $wp_post_types[‘attachment’]->exclude_from_search = true; }