Tag Info

New answers tagged

0

You need to use setup_postdata(). $post = get_post( $id ); setup_postdata( $post ); if(! empty( $post ) ){ the_title(); echo '<br>'; the_content(); } else { echo "No page found matching ID $id"; }


0

Yes, the correct tag is %monthnum%. Here's a list of all the default rewrite tags, for reference.


2

Your get_author_posts_url() seems wrong, it doesn't accept three parameters. Passing ID as first one should be sufficient to generate correct link, name argument is pretty redundant there.


1

I have run into the same issue that using $wp_query->set_404(); would properly adjust the global object but not return the 404 template. So in the plugin I was writing I used the tried and tested method: add_filter( 'template_include', 'wp_139917_force_404' ); function wp_139917_force_404(){ global $wp_query; $wp_query->set_404(); ...


2

Things are working the way they are supposed to, and possibly the only way they can work. Let me explain. Without an Apache module called mod_rewrite (or the equivalent Nginx or IIS component) requests to PHP pages have to go to an actual filesystem file. That is what you see with requests like 192.168.1.8/wordpress/?p=123. The file being accessed is the ...


0

WordPress will only handle 404's if pretty permalinks are enabled - go to Settings > Permalinks and choose one of the options other than default (or use your own).


-2

Change the instance of wp-pass.php to /wp-login.php?action=postpass


0

Go to phpMyAdmin and select the database for the website. Go to the "wp_options" table and edit the first option (option_name: siteurl) from "http://www.example.com/wordpress" to "http://www.example.com/somethingelse". In the same "wp_options" table, look for "option_name: home" and change the URL there too. Now, rename your current .htaccess file to ...



Top 50 recent answers are included