Broken wordpress permalinks on pages only

Do you have a custom post type? This is exactly the kind of behavior you will see from have a custom post type with a slug that matches the slug of your pages. For example, if you have a page called “portfolio” and a post type called “portfolio”, both with a slug of “portfolio”, 404s … Read more

How to change post to page

Yes Its Possible Just Simply Run This Query Once If You’re Not Developer Then Don’t to Anything Just Simply log in to your cpanel->open phpmyadmin->There is maybe one or more database you’ve to find which one is wordpress database (click on database and where all table names starts with “wp_” its your WordPress Database -> … Read more

Modify built-in post type properties

This is a pretty late answer, but I was looking to do something similar and figured it out. I wanted to get nav_menu_items into an RSS feed, which required changing the built in nav_menu_item post type property publicly_queryable. Anyway, it was actually pretty simple, here’s a generic function to do it: function change_wp_object() { $object … Read more

Can I display the widget admin in the page admin?

If I understand well your want to show the widgets adding and removing interface inside a meta box. An easy, -a little dirty- way is using an iframe: function metaboxed_widgets_admin() { if ( ! current_user_can( ‘edit_theme_options’ ) ) return; add_meta_box(‘metaboxed_widgets’, __(‘Widgets’), ‘metaboxed_widgets_admin_cb’, ‘page’); } add_action( ‘add_meta_boxes’, ‘metaboxed_widgets_admin’ ); function metaboxed_widgets_admin_cb() { if ( ! current_user_can( … Read more

Best way to manage a lot of pages in Wp Admin [closed]

This has been a reoccurring issue in WordPress. See these old trac links that are 9, 7 and 6 years-old respectively: https://core.trac.wordpress.org/ticket/3614, https://core.trac.wordpress.org/ticket/5303, https://core.trac.wordpress.org/ticket/14579 The challenge is that WordPress was built primarily for chronological posts since it began as a blogging tool. Page management was always secondary. WordPress still lacks an elegant solution for large-scale … Read more

How to edit the properties of a page programmatically?

If you look at the documentation, you can insert title, content, slug, etc. using wp_insert_post then use update_post_meta to assign the template to that post. You can write like this $post_arr = array( ‘post_title’=>’My title goes here’, ‘post_content’=>’This is my long content.’, ‘post_excerpt’ => ‘My Excerpt’, ‘post_status’ => ‘publish’, ); $new_post_id = wp_insert_post($post_arr); Then set … Read more

Get post by page name or slug

Hi @Zach Shallbetter: If I understand your question, then you are looking to solve your problem using theming functions when you really need to use more of WordPress’ API. The following code can be copied to a test.php file and run using http://yoursite.com/test.php for you to see how it works (assuming you replace http://yoursite.com with … Read more

Displaying images with relative paths in the editor

I had a client ask for that and it took a little while to get it but its simple: function change_mce_path_options( $init ) { $init[‘relative_urls’] = true; $init[‘document_base_url’] = get_bloginfo(‘url’); return $init; } add_filter(‘tiny_mce_before_init’, ‘change_mce_path_options’);