I want to add category slug in posts url
Go to permalink settings and select “Custom Structure” option listed on end. Then write /%category%/%postname%/. Save changes and now your post url will have category name too.
Go to permalink settings and select “Custom Structure” option listed on end. Then write /%category%/%postname%/. Save changes and now your post url will have category name too.
You can import the old wp_posts table in your current database with different table name, query and loop through it then update the current wp_posts post_content column from the old table where the ID matches. Here’s an example SQL which you can directly do inside phpMyAdmin (this updates everything in single query) UPDATE wp_posts SET … Read more
users followin the blog post author
There is no direct way of getting posts matching most of these tags using WP_Query. The usual documented methods: If you want posts matching any of these tags, you may use: $args = array( ‘post_type’ => ‘post’, ‘tag_slug__in’ => array( ‘poetry’, ‘motivational’, ‘attitude’, ‘rules’, ‘lines’, ‘sigma’, ‘inspirations’ ) ); $query = new WP_Query( $args ); … Read more
I hope you need to disable “Edit” and “Quick Edit” for non-admin roles. So you can modify your code as follows function remove_quick_edit( $actions ) { unset($actions[‘edit’]); unset($actions[‘inline hide-if-no-js’]); return $actions; } if ( ! current_user_can(‘manage_options’) ) { add_filter(‘post_row_actions’,’remove_quick_edit’,10,1); }
In my case, deleted posts from the dashboard were not deleted from the database. After deleting unnecessary posts from the database my problem is solved.
You can set this in your WordPress settings. Go to your Permalinks settings (WP Admin → Settings → Permalinks) and select ‘Custom Structure’. It should display your current structure in the text box next to it. Now, add /blogs in front of what is in the text box. And then Save. See screenshot for reference
Unfortunately we cannot use attachments for obvious reasons, an image can be attached to one post/page only, it does not have to be attached, at all, in order to be displayed as part of your post/page. Where all tags can be found? In a content of post/page. We can use the_content hook to have access … Read more
Notify/check if the content of a custom gutenberg block has changed on save_post
Hooks cannot be added directly inside functions. Using do_action, you can invoke a custom hook. In your case try out the below solution: add_action( ‘wp_insert_post’, ‘automate_intercom’, 10, 3 ); function automate_intercom( $post_id, $post, $update ) { if ( $post->post_status == ‘publish’ && $post->post_type == ‘help-center’ ) { $someCondition = ”; if ( $someCondition !== ” … Read more