Changing permalink of WordPress

You should never have to touch the mod_rewrite rules. WordPress flushes/rewrites them to .htaccess whenever you save settings on Dashboard -> Settings -> Permalinks. If that’s not happening, then something is wrong, either with your file permissions, or your local server setup. Also, it is strongly advised NOT to use %postname% alone as your permalink … Read more

page template – undefined structure in source code

Search all your theme and plugin files for: <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN” Disable all plugins and re-enable them step by step. This document type declaration is not part of WordPress’ core files; there is a filter active somewhere. Update Try to remove all filters from the affected functions. Start with wp_list_pages(): remove_all_filters( … Read more

list child-pages as normal pages?

you can use get_pages() function, something like this: $mypages = get_pages(); echo ‘<ul>’; foreach($mypages as $page){ echo ‘<li class=”page_item page-item-‘.$page->ID.'”><a href=”‘.get_page_link($page->ID).'”>’.$page->post_title.'</a></li>’; } echo ‘</ul>’;

Set page to draft on plugin deactivation

I’m posting this as another solution for you and its based on the page id /* $post_id – The ID of the post you’d like to change. $status – The post status publish|pending|draft|private|static|object|attachment|inherit|future|trash. */ function change_post_status($post_id,$status){ $current_post = get_post( $post_id, ‘ARRAY_A’ ); $current_post[‘post_status’] = $status; return wp_update_post($current_post); } So once you have this function you … Read more

Default Permalink Structure for Pages

For the example you’re using (ie www.mysite.com/pagebase/page1) you can: create a page called pagebase create a page called page1 and make pagebase the parent page – the url for this page will be www.mysite.com/pagepage/page1 This does mean that www.mysite.com/pagebase also exists as a browsable page, but I generally use that as a section description and … Read more

Making a new post visible on a specific page

I would solve this using the plugin Advanced Custom Fields. 1) create an ACF item with the following config view larger 2) it will show a metabox when editing a Post, where you can select which Page the post should appear 3) in your page template, adapt this code to your needs <?php // START … Read more