// If there's some posts, let's go get them
if(have_posts()) : while(have_posts()) : the_post();
// If a post background has been provided... let's go get it.
if(get_field('sst_background_photo')) :
When you say "alongside" do you mean, literally to the side of, like in a sidebar/separate module? Or do you want them to appear mixed in with other post types?
So, I think I managed to do it. I added this before if(have_posts()):
// query the posts of your custom post types
query_posts( array(
'post_type' => array(
'post',
'name-of-custom-post-type',
),
'paged' => $paged ) // for paging links to work
);
How can I get a custom post type I've setup to appear in the loop on my homepage, alongside my posts? I've got my custom post type acting as a post.
functions.php add_action('init', 'portfolio_register');
function portfolio_register() {
My post loop begins like this:
When you say "alongside" do you mean, literally to the side of, like in a sidebar/separate module? Or do you want them to appear mixed in with other post types?
@andy_unleash Sorry, I mean mixed within the normal posts on the homepage.
So, I think I managed to do it. I added this before if(have_posts()):
You may want to use WP_Query, when I did codeboxers over Christmas I ran into trouble with pagination.