Inserting image into post content – Front End

The content of the post is just that – the value of post_content field. You could retrieve HTML for attachment by wp_get_attachment_image() and either pass it to wp_insert_post() initially (will need to create attachment earlier for that) or use wp_update_post() to assign content to already existing post.

Get one custom taxonomy category

Your logic looks to me like it boils down to “if union is selected, then echo a link to union, else do nothing.” I think your description is much too complicated. It looks like you can effectively ignore paid completely. function wpv_check_for_union_func($attr,$content=””) { global $post; $taxonomy = ‘yourtaxslug’; $union = has_term(‘union’, $taxonomy, $post); if ($union) … Read more

Add a tag like a post

There is no native functionality in WordPress to relate posts to each other (only group posts with taxonomies). You will either have to develop custom solution, or try to make use of existing plugins. Posts 2 Posts is considered staple for post relationships.

WordPress rewrite question

Here’s an endpoint solution as mentioned in my comment. First, add the endpoint by adding this code to your theme’s functions.php file: function wpa_add_rep_endpoint(){ add_rewrite_endpoint( ‘rep’, EP_ROOT ); } add_action( ‘init’, ‘wpa_add_rep_endpoint’ ); Then visit the Settings > Permalinks page in admin after adding the endpoint to flush the rewrite rules so this endpoint will … Read more

How to use in_category?

It looks like you’re mixing the WordPress in_category() function with plugin / theme code that isn’t setting up a standard WP Query or post object. So you can’t use in_category(). Use var_dump($content); and var_dump($data); to see if either of those objects have a ‘category’ property for the content. Use that in an if statement instead, … Read more

Where to find new class reference or function of deprecated one?

The deprecated functions are listed in the following files. /wp-includes/deprecated.php /wp-admin/includes/deprecated.php /wp-includes/pluggable-deprecated.php /wp-includes/ms-deprecated.php /wp-admin/includes/ms-deprecated.php As to whether the Codex is updated with the above I have no idea, but like always.. when in doubt look into the actual core code. Use an IDE or text editor that has a good find in files search, so … Read more

How to limit characters in Academica featured posts widget?

I am guessing that this is the theme you are talking about. If so, I don’t see any specialized filters that would let you alter the character count of the excerpt. The widget does use get_the_excerpt() so you should be able to alter the character count with Core filters though. function excerpt_trim_cb_wpse_114219($excerpt) { remove_filter(‘wp_trim_excerpt’,’excerpt_trim_cb_wpse_114219′,1000); return … Read more