URL Forwarding – wordpress links reverting back

The internal links are all hard-coded; you’ll have to do a search/replace in the database to fix them. This is a good script for search/replace that will go through your posts, widgets, everything: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Download the script, and upload it into your WordPress root directory (same path as wp-config.php). Surf to the script, then follow … Read more

page url in shortcode

Depending on how the page’s query and loop are constructed, when you access the post object from the sidebar or footer, you sometimes get the last post in the loop rather than the page itself. You can ensure you’re getting the original (page) object by running wp_reset_query() from inside your widget (before you access the … Read more

How can i maintain permalink structure and avoid a 404 error when loading external content?

You could use a WordPress rewrite (as opposed to mod-rewrite) to solve the issue. function createRewriteRules( $rules ){ $newrules = null; $newrules = array(); $newrules[“catalog/?$”] = “index.php?page=xx”; $rules = $newrules + $rules; return $rules; } add_action(‘rewrite_rules_array’, ‘createRewriteRules’); You’ll need to flush the rules: http://codex.wordpress.org/Function_Reference/flush_rewrite_rules Your page-catalog.php file could then sniff the original url and do … Read more

Images in sub-pages fail to load

Your problem has nothing to do with htaccess. It’s that you’re using relative paths where you should be using absolute paths. (Here’s an explanation of the difference) Probably the best way to reference any assets in your theme (assuming your theme has an “images” subdirectory) is to do something like: <?php echo get_bloginfo(‘template_url’) ?>/images/your_image.jpg The … Read more

Get current WordPress page then add #post ID to the end

Your answer should return: “ so from there you just do this: $final_url = $URI.’#’.get_the_ID(); Which should echo http://mydomain.com/current/page#372 which is kinda good for linking. But if your looking for a “bookmarks” link it would be best practice to do this (inside the loop): echo ‘<a href=”‘.the_permalink().'” title=”‘.the_title().'”>’.the_title.'</a>’; Which will echo “Interesting Page” (note the … Read more

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