custom template only for content

You can’t override template parts. Even if you could, you would have no way of knowing what template part you’d need to replace. A theme is only required to have an index.php file and there are no restrictions or naming convention for template parts. Your options are to create a full template and leave it … Read more

Add new post using a page inside the website

You have never read the WP documentation? Create any template and form and when submitting the form it could be Example: $args = array(‘post_type’=>’post’, ‘post_title’=>’your title’, ‘post_status’=>’publish’, ‘post_content’=>’post content’); wp_insert_post ($args); This will allow any post page or custom post type to insert the post

Code fails in plugin file but works in functions.php

You need to use a hook and a function in your plugin file. For example: function sher_posts() { $pages = get_posts($args); foreach($pages as $page) { $out = get_permalink($page->ID); } } add_action(‘wp’, ‘sher_posts’); Of course this example doesn’t know what $args are or what to do with $out.