Page load requires a trailing “/” [closed]

sounds like a .htaccess issue use a standard theme – still got the error? yes –> investigate your .htaccess file in the root of your site is the rewrite module loaded –> check with phpinfo() on your local server no –> investigate a .htaccess file within the template directory in both cases: check the rewrite … Read more

Export only pages and posts with mysql dump

This is generally not a good idea. See this WordPress database diagram. You need to consider: posts that have categories or tags (terms), their relationships, term meta, and taxonomies posts that have authors (users) posts that have comments things that are actually posts that you might not realise are posts (eg. almost everything in WordPress … Read more

why does HTML Tag not working in Post and Page

[*] It’s not the theme that’s how TinyMCE editor works. If you remain on the “Text” tab and update the post then the html will remain untouched and display properly on the front-end. However if you switch back to the “visual editor” it will break. Here, you can use this on your functions.php // Modify … Read more

How to change redirect after moving a page to trash?

Hook into load-{screen_id} and check if the $_GET[‘trashed’] variable is 1 or above. add_action(‘load-edit.php’,’wpse_trashed_redirect’); function wpse_trashed_redirect(){ $screen = get_current_screen(); if(‘edit-page’ == $screen->id){ if( isset($_GET[‘trashed’]) && intval($_GET[‘trashed’]) >0){ $redirect = add_query_arg(array(‘page’=>’custom_page_oder’, ‘trashed’ => false, ‘ids’ => false )); wp_redirect($redirect); exit(); } } } This works – and I’m not aware of a better way of doing … Read more

Using JavaScript and JQuery in Page

jQuery is default active in WP, no need to enable it. There are 2 ways of including your own jQuery in WP: Enqueue your own file containing the jQuery (preferred method) Use the wp_head or wp_footer action hook to include a script with jQuery. I’m only going to explain how to enqueue scripts in WP. … Read more

How to get the list of posts in a static page other than front page?

The way I retrieve posts on my blog is to use the following: <?php $recentPosts = new WP_Query(); $recentPosts->query(‘showposts=5&cat=CAT_ID_GOES_HERE’); while($recentPosts->have_posts()): $recentPosts->the_post(); ?> Then you would go and create the code to control the display of each post. So for a really simple example: <h1 class=”title”><a href=”https://wordpress.stackexchange.com/questions/3170/<?php the_permalink(); ?>”><?php the_title(); ?></a></h1> Then at the end of … Read more

Why is custom template not seen as page with is_page()?

When you call query_posts($query); in your second template, you overwrite the global variable that WordPress uses to return the correct values for the is_ conditionals. You should basically never use query_posts in the template. For secondary loops, use a new instance of WP_Query instead.