List posts of assigned categories in list of all categories on single.php

Solved it with following code. My idea posted above worked out, but I had to rearrange the assigned categories in a new array. <ul> <?php $cargs = array( ‘type’ => ‘post’, ‘child_of’ => 0, ‘parent’ => ”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 0, ‘hierarchical’ => 1, ‘exclude’ => ‘1’, ‘include’ => ”, … Read more

Create new post on user registration

Check out the documentation for the get_user_by() function – ‘user_firstname’ and ‘user_lastname’ aren’t properties of the returned object. This is because this data is not a part of the user model – rather they are stored in user metadata. You should be able to use the get_userdata() function, as it returns an object containing both … Read more

Static text above category page

You can use the the_excerpt and maybe also the_content filter hook, to catch when the excerpt is going to be print, and output your text before that. Those filters are called just before the current post excerpt (or content) are printed to page. Sample code: /** * Function that runs when the excerpt for the … Read more

insert thumbnail image from php script

You’ll want to take a look at wp_insert_attachment and wp_generate_attachment_metadata. You can’t insert a featured image/thumbnail using the_post_thumbnail – that function only gets the thumbnail for the current post. See: http://codex.wordpress.org/Function_Reference/wp_insert_attachment and http://codex.wordpress.org/Function_Reference/wp_generate_attachment_metadata

Send the post id to a front end edit post form

The post id is sent correctly. What I needed to do was to add the bellow code to the getForm() function, before ob_start(): $post_to_edit = array(); $post_to_edit = get_post( $_POST[‘postid’] ); $this->data[‘item_name’] = $post_to_edit->post_title;