New answers tagged

2

Well, AUTH_KEY and it´s brothers where introduced in WordPress 2.6 to improve safety for logged in users. They are used to encrypt and validate the information in your backend login cookie. While revealing the AUTH_KEY alone might not be a real security issue, you should nevertheless not output/use this anywhere to give less surface for attacks. ...


1

If the front page is set to display posts then the query for those posts will run regardless of wether your theme shows these posts or not. That's why you're getting pagination with no posts. You can test this by temporarily removing your themes front-page.php (or whatever it is). You should see all your posts with correct pagination. You have 2 options to ...


1

The first form: <form method="post" action="some-url.php"> <input type="email" placeholder="Email address" value="" name="email"> <input type="submit" value="Submit" name="email-submit"> </form> Then in some-url.php: if( isset($_POST['email'] ) $email = $_POST['email'] The post method would be preferred here since it ...


1

Kind of depends on where you are in the WordPress environment. Plugins If you're in a plugin, you can use plugins_url. <?php $url = plugins_url('css/admin.css', __FILE__); The above will give you the path relative to the file passed into the second argument. So if you're in the main plugin file you might get something like ...


0

The best way to move an WordPress website to another URL is by exporting, replacing and importing the database. Try doing this by using PHPMyAdmin or another database management tool. For phpmyadmin just select your database and click on export. After downloading the export of your database, open it in a simple texteditor (Notepad++, Textwrangler) and fire ...


0

Have you checked this one? If no just check this post. Hope this will help you to solve your problem http://codex.wordpress.org/Changing_The_Site_URL


0

Here's the why part: This part of the redirect_canonical() is removing the leading & in the redirect query part: // tack on any additional query vars $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] ); Example: example.tld/?&a=1&b=2&c=3 is redirected to example.tld/?a=1&b=2&c=3 If you must have ...


0

You can use here rawurlencode() function. First pass "?&mkwid=smWfvaLGf_dm" this url into the function then you will get "%3F%26mkwid%3DsmWfvaLGf_dm" encoded value. Now go on the functions.php and put this code there (But this code will run on every call of you site) //for accessing current url $accessUrl = get_site_url() .$_SERVER['REQUEST_URI']; ...


5

I want ot give you an "alternate" approach. I'm pretty sure you're not going to follow this, but I thinks is interesting to read. OOP "routing" approach In WordPress, "pretty" urls are mathed to "ugly" urls. But most web frameworks (not only PHP) uses the concept of "routing": to match an url to an "action" (or a controller). I want to give you an idea ...


0

This is solution of your 404 links problem, Got to Settings -> Permalinks -> In 'Product permalink base' select the 'Shop base with category' option. For more you can visit, https://wordpress.org/support/topic/permalinks-404-with-custom-post-type


1

It looks like you use the Jetpack Plugin with Photon function (Wordpress.com photo CDN) https://jetpack.me/support/photon/ https://developer.wordpress.com/docs/photon/ You have to deactivate the Photon option in the Jetpack plugin settings.


5

I am not sure if this is the best solution or not, but it works: function movie_review_permalink( $url, $post, $leavename ) { $category = get_the_category($post->ID); if ( !empty($category) && $category[0]->slug == "test" ) { //change 'test' to your category slug $date=date_create($post->post_date); $my_date = ...


0

Are you sure your custom post type has a separate single.php file? I was having a problem and this was the situation: I have three custom post types. I recently created the new one and its permalink redirects me to a diff custom post type's page. I have tried all rewrite flush rules etc but then I came to realize that the problem was because I don't have a ...


0

After digging a little deeper, I found that there is an action hook in Gravity Forms called gform_pre_submission. This allows me to modify a posted value before creating an entry or running the confirmation (see documentation). After that it was pretty basic: add_action( 'gform_pre_submission_11', 'pre_submission_handler' ); function ...


1

You can read data on your server with file_get_contents(). If you want to make sure the file exists and is readable then use is_readable(). You don't really need to use trailingslashit() in this case because you're constructing the URI yourself. // path to file under current theme $json_file = get_template_directory() . ...


0

Make sure you have the Text / HTML tab selected when you input HTML, not the Visual tab.



Top 50 recent answers are included