How to show meta value code HTML after x paragraph

The purpose of echo is sending strings to the output buffer. In your code you are concatenating the result of 4 to the result of the call to echo, which returns nothing. Also, get_post_meta already returns a string so you don’t have to do the type cast. Try: add_filter( ‘the_content’, ‘prefix_insert_post’ ); function prefix_insert_post( $content … Read more

{$key} or $key?

When we perpend $ in any variable then it become Variable variable (Variable vars) like $$name Check this reference for Variable variable. https://www.php.net/manual/en/language.variables.variable.php Here $this->$key will become Variable var because it is about public/private/protected variable of class. So {} in $this->{$key} will set $key vars variable of class

page-slug.php not working but only for specific slug

I thought it might be conflicting with something I had in functions.php, however nothing else was using the name “comics” There is, here: // Arguments $args = array( ‘labels’ => $labels, ‘public’ => true, ‘menu_icon’ => ‘dashicons-book-alt’, ‘hierarchical’ => true, ‘exclude_from_search’ => false, ‘has_archive’ => true, ‘publicly_queryable’ => true, ‘rewrite’ => array( ‘slug’ => ‘comics’, … Read more

Foreach loop inside an array_merge

Someting like this? foreach ($subscribers as $user) { $users[] = array( ‘label’ => $user->display_name, ‘value’ => $user->display_name ); } Then do the array_merge with $users

Find Site ID From WP_Post

No, post objects do not store this data. You need to store the site ID separately. Post objects do not store the site they were created on or are currently hosted on. That information doesn’t exist in the posts table, nor does WordPress track it elsewhere. The assumption is always that the post comes from … Read more

How to remove the h6 tag for the entry-category Class

You don’t need functions for this, just look in your theme’s template files: For single posts check single.php and for blog archive/categories check archive.php. Change the <h6> in those php files to <div> or whatever you want. It would be wiser to override them with a child theme so you don’t lose your changes in … Read more