Countrywise Post View

It’s possible, let’s say you want to affect all post queries like this, you will need to get the country of origin and then change the query. Given you have two categories, something like Russian news and Japanese news, you could do it basically like this: /** * Returns origin country of request if available … Read more

Hide or remove custom post status

I found the solution i was looking for, if anyone in the future has the same question i am posting the answer. To make a post with lets say “Status1” to show only “Status2” and hides other statuses like “Status3 and Status4” (with css): function hidepoststatus() { $post=”Status1″; global $post; if ( $post->post_status == ‘Status1’ … Read more

How publish post from pending status

When WordPress gives you errors such as that the post needs an author and permalink, it is best to figure out a way to provide these. Otherwise you are asking for trouble further down the line. You might find a way to force it, but it would be an uphill battle. WordPress is like a … Read more

What permissions does a role need for the user to be assigned as the author of a post?

You probably need to add 3 capabilities: edit_published_posts publish_posts delete_published_posts but at the very least, you need to add publish_posts as that is the capability WordPress uses to determine what users are shown in Authors drop-down. Note: Changing capabilities is stored in the database so the recommendation is to modify these values via a plugin … Read more

Unable to edit or post after enabling SSL

Have you tried flushing permalinks? Sometimes not everything changes right away. Step 1: In the main menu find “Settings > Permalinks”. Step 2: Scroll down if needed and click “Save Changes”. Step 3: Rewrite rules and permalinks are flushed.

Delete attached images from posts

Having that resulting XML file from the export it’s just a matter of editing it precisely to get rid of the images before importing it on the other site. Taking Sublime Text for example it’s pretty easy to find and select all occurrences of [caption and add a line break before them for example. Same … Read more

Save ACF with a save button on a post

$settings = array( ‘form’ => false, // ‘field_groups’ => array(290), ‘fields’ => array( ‘field_5ba88d1dee1ef’ ), ); acf_form( $settings ); In the above code you can add the multiple fields in the fields attribute. Inside the array you can add the key of the acf fields as many as you want. If you want to show … Read more