Defined function isn’t showed on page

There’s no relationship between how the function is written, and how you’re attempting to use it. The first problem is that your function returns a value, rather than echoing it. So if you wanted to output the value you need to use echo: echo social_sharing_buttons(‘post’); But the usage of ‘post’ doesn’t make sense here. Your … Read more

Parent category / child category posts

OK solved! I have a post called “Cardio” with a child category name “Cardio”. I created a category-cardio.php (cardio is the child category) but the page doesn’t display the post “cardio” same name as the category. <?php /** * Cardio category template * * @package clf */ get_header(member); ?> <div id=”primary” class=”content-area”> <main id=”main” class=”site-main”> … Read more

why str_replace targeting pages instead just targeting post?

Your code is returning $text only for posts and nothing for other post types like pages. Your function should be like this add_filter(‘the_content’, ‘replace_word’); function replace_word($text) { if (is_singular( ‘post’ )){ $text = str_replace(‘dog’, ‘cat’, $text); return $text; } // you must return content for pages/ other post types return $text; }

How to add convenient buttons for new custom post statuses

There is a work tool set that works nice for this kind of add on, called CMB2. You can add all the fields and buttons you want as part of a metabox series. Metaboxes are what make up the admin section section of wordpress. https://wordpress.org/plugins/cmb2/ For example..a snippet: function custom_post_status() { register_post_status( ‘spam’, array( ‘label’ … Read more

Force fill all fields when creating a new post

I’ve been looking for a suitable solution for this as well. I came across this plugin which will make certain fields mandatory before a post can be published. Hope you may help with this. https://wordpress.org/plugins/required-fields/

Get post number both in the loop and in the post

You can do it like this on single post page following this answer. The code may need some tweaking to meet your exact requirements. Put this in functions.php of your theme class MY_Post_Numbers { private $count = 0; private $posts = array(); public function display_count() { $this->init(); // prevent unnecessary queries $id = get_the_ID(); echo … Read more

Does WP automatically tag posts into the archive?

What your looking at there is a tag called “how to compliment a women”. The first result is your tag/category page being indexed by google, which is normally a good thing. The word Archive is being added via your theme but it just means its a category/tag page that will display a list of posts. … Read more