Permalink not working for page without title

TL;DR: go the the edit post screen, clear the Post permalink/slug (found immediately below the Post Title field) by clicking “Edit”, and then deleting the existing text, and save. So, what’s happening here: On the site where the Theme Unit Test data are hosted, the ID of the post in question is 14. When you … Read more

Post type child of another post type

Attachments are post types someway, when you attach images to a post/page and display them in your post, you get a link like your-post-title/attachment/filename/. Maybe you can create post types with hierarchical option and them filter the link to replace the attachment to post parent name instead.

Prevent WordPress from abbreviating-long-slugs…-in-the-admin

There is a filter at the end of the function: ‘get_sample_permalink_html’. Hook into this and just replace the shortened form with the full length. <?php # -*- coding: utf-8 -*- /* Plugin Name: T5 Unabridge Permalink Slug */ add_filter( ‘get_sample_permalink_html’, ‘t5_unabridge_sample_permalink’, 10, 2 ); /** * Replaces the shortened permalink with its full form. * … Read more

How can I store page ID in a post instead of other selected permalink?

Add that to your functions.php: function wp_link_query_mod ( $results ){ if( count( $results ) ){ for( $i=0; $i<count($results); $i++ ){ $results[$i][‘permalink’] = wp_get_shortlink( $results[$i][‘ID’] ); } } return $results; } add_filter(‘wp_link_query’, ‘wp_link_query_mod’); This hook is only usable since WP 3.7, if you have an earlier version then there is an alternative but it would mean … Read more

Change slug on post creation

Here is what I did to implement this: function slug_save_post_callback( $post_ID, $post, $update ) { // allow ‘publish’, ‘draft’, ‘future’ if ($post->post_type != ‘post’ || $post->post_status == ‘auto-draft’) return; // only change slug when the post is created (both dates are equal) if ($post->post_date_gmt != $post->post_modified_gmt) return; // use title, since $post->post_name might have unique … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)