How to deal with a GET variable of ‘name’?

In case it’s useful for someone else in this situation, I ended up creating a page outside WordPress which renames the ‘name’ parameter (to ‘username’) and then redirects to the page I originally wanted to hit. My code for this external page is: <?php $data = array(‘UID’ => $_GET[‘UID’], ‘username’ => $_GET[‘name’], ‘ANI’ => $_GET[‘ANI’], … Read more

Enhancin 404 to contain a search from URL

WordPress doesn’t deeplink to any php file for the front end. Instead, everything is passed throug the url as a query, like so http://your-blog-url.com?p=123. If you wanted to change that behaviour, you could edit your permalink structure in multiple ways. Just go to settings->permalinks (i have no idea what that is in czech, but its … Read more

Need help changing back the correct wordpress url

Did you follow the steps outlined here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory Specifically did you copy the .htaccess and index.php files back to the root and edit the index.php file with correct filepaths as stated in points 7 – 9? Update The problem was solved by modifying these two options in the wp_options table: siteurl home (See comments)

Modifying WP URL handing code?

I ended up solving this with a little bit of code (in the form of a plugin): if(isset($_GET[‘state’]) OR isset($_GET[‘city’])) { $url = explode(“https://wordpress.stackexchange.com/”, $_SERVER[‘REQUEST_URI’]); $url = end($url); $_SERVER[‘REQUEST_URI’] = “https://wordpress.stackexchange.com/” . $url; } This code in essence removes the “/arizona/” or “/arizona/phoenix/” from the REQUEST_URI global variable and replaces it with “https://wordpress.stackexchange.com/”, which then … Read more

How do I allow http/ftp access to files I have uploaded?

You might check out a plugin like this one. If you don’t want to go that route, I’d suggest using a page template and a technique like this to list out the files. Lastly, assuming you’re using apache, you could set apache to allow listing directory contents (not the best idea, IMO) and then edit … Read more

custom url – add attachment’s id or name after post

Showing links to attachments in the desired format Loop through the attachments and generate the link you want: $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => null, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo ‘<a href=”‘ . get_permalink() . ‘video/’ . $attachment->ID . … Read more

How can I prepopulate the URL address for the add media button

You can apply a filter to the output of the media insert url form using the filter named wp_media_insert_url_form: add_filter(‘wp_media_insert_url_form’, ‘ex46632_media_insert_url_form’); function ex46632_media_insert_url_form($html) { $html = str_replace(‘<input id=”src” name=”src” value=””‘, ‘<input id=”src” name=”src” value=”http://mysite.com/images/”‘, $html); return $html; } Something like this could be added to your theme’s functions.php file. This is untested code that is … Read more

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