If you’re anything like me, you have random thoughts that you’d like to share with your readers. Chances are you don’t want comments or for them to go out in your RSS feed.
Well I have good news for you — creating a Stream page like mine is so incredibly simple that you can pull it off in 30 seconds. So now you can have your own personal Twitter.
Creating Your Stream Page
The first step is to place the code below into your child theme’s functions.php file:
/** Create stream custom post type */
add_action( 'init', 'stream_post_type' );
function stream_post_type() {
register_post_type( 'stream',
array(
'labels' => array(
'name' => __( 'Stream' ),
'singular_name' => __( 'Stream' ),
),
'has_archive' => true,
'hierarchical' => true,
'public' => true,
'rewrite' => array( 'slug' => 'stream' ),
'supports' => array( 'title', 'editor', 'custom-fields', 'genesis-seo', 'thumbnail' ),
)
);
}
Be sure to save your permalinks once you’ve added this code. Go to the Settings > Permalinks page in your WordPress dashboard and click the “save changes” button.
The next step is to create a archive-stream.php file and place it into your child theme folder. Inside that file place the following code:
<?php
/** Remove the Genesis post content and replace with WordPress */
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
add_action( 'genesis_post_content', 'the_content' );
/** Remove the post title */
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
/** Relocate the post info function */
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_after_post_content', 'genesis_post_info' );
/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
genesis();
Styling Your Stream Entries
If you want to style the entries of your stream, here is some sample CSS you can use:
.post-type-archive-stream .hentry {
border-bottom: 1px dotted #ddd;
margin: 0 0 25px;
}
.post-type-archive-stream .post-info {
color: #999;
font-size: 12px;
margin: 0 0 25px;
text-transform: uppercase;
}
Go to the Stream > Add New section inside your WordPress dashboard to publish your stream entires. Then you can access your stream at the /stream/ page on your website.
This reminds me a lot of Asides.
It’s pretty much that, but I didn’t want to go through the process of enabling post format support and having to exclude these from my blog feed.
Awesome, thanks Brian! Now I just need to figure how to use it well on my personal blog
I’ve wanted to use post formats for this, as Jason pointed out, but realized it was easier to just pull off this way. Of course there are a number of ways someone can do this, but I’ve simply written how I chose to.
I’ve been considering doing post formats on my blog recently after leaving Tumblr. I really grew to appreciate the different formats, even if most of the posts are plain text. This might be a quick and easy way to test those waters.
I think post formats are perfect for creating an entire Tumblr-style blog, so don’t get me wrong. Since my “stream” was really only going to be asides, it was easier for me to whip the code above in my functions file and roll from there.
Word. Thanks again as always
Wow. Cool. This is definitely a useful middle-ground between post and FB update. As always, thanks for the code!
I’m going through a custom post type phase where I have a number of them being used here on my site. It’s just fun to field a way to drop “asides” on my site for people to see without having to update every social media platform with them.
Thanks, Brian.
Did the code work. Can’t seem to find out how to write and publish my stream to the stream page. I assume I am to write a new blog post…. Any help would be great.
No, there should be a “Stream” menu item link in your dashboard, probably under the “Comments” link.
Found it! Perfect. Thanks for the help.
All I need now is the Minimum Theme
The hope is to release that on Wednesday.
Brian… how do I get rid of the post meta sitting on the bottom of each Stream Post. There is meta on the top AND bottom. I tried using Firebug…can’t seem to figure it out. Thanks.
Inside the archive-stream.php file, place this code:
I forgot to mention that, as I already have my post removed theme wide.
Still have the “file under:” meta still showing. Anyway to remove this?
A cheap way to do it would be to add this to your CSS:
Cheap works! Thanks, Brian.
Thanks Brian, that is GREAT News, hope you’re not just teasing!
That would be… TODAY!! HURRAY! I’ve been waiting for this!
I’m going to buy NOW! I LOVE LOVE LOVE this theme. Mostly the home page.
Brian,
Your blog – and the stream page – are looking great.
Two questions:
Is it necessary to place the stream on a separate page?
I take your point about not wanting these posts in feeds. We’ve got licenses for every Genesis theme which supports post formats, sandboxing them so we can switch one or more sites to Genesis. Would it be possible to put control of whether a post format is part of the feed in the theme settings, or is that an enormous coding burden?
Jon
Hey Jon, answers below:
1. No it’s not, but for my use I wanted to have just one page where I house them.
2. Yes, you could technically do this as “posts” with an aside post format. If you do that, best to create a “stream” category, and then exclude that category from your blog feed.
Wow,
I didn’t realize that it was that simple, custom post types… I keep seeing more and more how powerful CPTs are. I do have a question though, If I have mulitple CPTs running at once, would it be easier to make a “cpt.php” file and put all the code in their, and then include( ) or require( ) it into the functions.php for efficiencies sake?
If you do, I’m guessing you’ll have to make it an archive.php file, so that it’ll work that way. Because I customize some of my custom post type archive pages (for example) it was easier for me to just create separate archive-X.php files.
I have a question!
Will each update/post will have distinct url like any other post or will the post accessible for site.com/stream/ only??
Yes, like all custom post types they do. (for example)
Because I didn’t want any comments or what not, it made no sense to me to make the single pages linkable.
Hmm!! Then what could be the SEO effect on the site. If we have plenty of such posts? Each post will have very less content (only a small paragraph).
Sorry for being off-topic (more or less)
I think it will be better to index only example.com/stream/ and block all posts of the stream (like example.com/stream/post-slug). What you think??
Hi Brian,
this is a great idea.
Like some of the previous posters I instantly though of “asides”.
I would want to put them in the sidebar or footer as well I think.
Hmmmm, I guess I could simply add a function to the functions file instead of (or in addition to) the page template and set that up so it would place the entries at the top of the sidebar for example.
Or one could turn this into a widget, but that is still beyond me I’ afraid…
Cheers,
Jan
I hear ya – and like I mentioned before, I’m only documenting the process that I use here for my site. As I’ve noted, there’s other ways to do something like this.
Brian, Thank you for sharing the code for this “tool”.
Two Q’s:
(1) The Post Meta was showing up, so in the Archive-Stream.php file I changed
add_action( ‘genesis_after_post_content’, ‘genesis_post_info’ );
to
remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
Will that cause any problems? (It seems to be working fine.)
(2) The code to style the entries of the stream don’t seem to be showing. Particularly the dotted line under each Stream item. I would appreciate any thoughts or suggestions on this.
Thank you for sharing your tips and tricks! – Theresa
Hey Theresa:
1. Thanks, I actually just put the remove post meta code into the tutorial – if it’s working fine for you, should be good to go.
2. Can you link me to the page? You might have to do a hard refresh to clear your browser cache.
Thank you for your reply.
(1) I saw the updated archive-stream.php. Is it “cleaner” to have the
/** Remove the post info function */
and the
/** Remove the post meta function */
separate, for example this is what I currently have in that file…
/** Remove the post info function */
remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
(2) Sorry, I don’t know what a “hard refresh” is. I have been having a little issue where changes are sometimes not reflected for a day.
I tried removing the cookies and the cache (I’m using Firefox 15.0.1), no changes yet. (This is my “test” site where I prep before I launch.)
Thank you again for your reply – Theresa
Thank you for doing so many posts on custom post types. I just did my first one a couple of weeks ago, and your posts have really helped me see how to use the genesis hooks to save coding.
And because I looked at your stream today I saw your page listing Google Fonts. Thanks again for the insight!
I’m very excited to hear that not only are folks reading these tutorials, that they are using them for their own sites. Shows the time I spent was worth it!
Hey Brian! Loving this and the portfolio instructions. For some reason, I am getting a ‘read more’ in my Stream. Any idea why?
Do you have any more tags placed in the stream?
I’m not sure what that means. Did I tag the ‘post’? No. Perhaps I shouldn’t have given it a title?
I think Brian means ‘more’ tag, that is, (In HTML View).
Please check if you have placed this in your stream entry.
Hi Aditya, thanks for explaining that. No, I don’t have any more tags in HTML view. My stream is also linking to its page even though I don’t want it to. I wonder if that has something to do with it. I’m going to look at Brian’s code again, I probably copied something incorrectly.
Thank you! It is cool ideas and code sharing like this that make me pleased to have been a customer of yours since back in the Revolution days.
Thanks Marc, always nice to remember those who were customers from back in the Revolution days. And you fall into that category.
Hi Brian, thanks for your hard work… It IS appreciated!
Just a question on setting the page width. I am using this in education child theme and the default page is 3 column, which is how the ‘Stream’ has defaulted to. Can I make the stream page full width?
Yes, you can – stick the code below in the archive-stream.php file:
Doh! Of course. Thanks Brian, I ended up using this for the 2 column layout, in case anyone has a similiar question:
add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_content_sidebar’ );
Awesome stuff. I’m working on a site these would be perfect for, actually.
Quick question, though – what would I need to add back to the code that would allow me to add a title back into it? I see you have them on the top portion of your pages, but in a standard theme (News), how can I get that part back?
I love this stream! It’s like twitter except people don’t have to sort through your replies. I am going to be treating my stream like gold. Thanks Brian!
Thanks Brian.
I just implemented on my blog. Styled it to look perfect.
I have a question, like in your stream page there’s a title saying “What’s On My Mind”. That’s good thing so that viewer can understand what is it. I would like to do same with my theme, but only for my stream page, I know it is “Theme” based but can you give me hint how can I add a title to stream page, that’ll be awesome.
Thanks again.
-Aditya
I would like to know this too:)
Inside the child theme’s page-title.php file, add this code in the conditionals:
I’m confused to where to add this:) It’s not to the archive-stream.php is it?
thanks for the help:)
I’m still confused, I know its simple for most lol..is this wrapped in php tags?
Could you please make this more clear and simple? thanks, all I really want to do is add a tittle and date like yours but don’t understand what to edit. I added it to the archive-stream and caused an error.
I have a little in paypal I could pay someone for help. Thank you very much.
Ray
I think you’re guiding us for “Minimum” theme but we’re not using it. I’m using “Streamline” theme.
Can you please tell us how do we use / add page-title.php, for other themes, only for stream page?
Thanks again.
Great idea… i post ideas all the time on my blogs
One Question:
Will this work with remote posting via Windows Live Writer?
It works brilliantly with categories, but I have no idea about a stream page…
I don’t care about anything fancy, just duplicating your stream page on my Minimum theme based site is fine
Pre-Revolutionary Jim
reading more on your blog about streams….
Looks to me like the simplest way to have a stream
is to create a category for this, and then eliminate that one category
from the RSS feed?
Is that correct?
Everything runs thru feedburner… is that OK too?
==>Jim
Yes, that is probably the best way to do it Jim.
Cool.
Done!
This IS the most beautiful theme on the planet, you know.
==> Social Business Jimmy
Thanks Jim, really appreciate hearing that!
yeah, but even with Pluto off the list…
you still have 7 more planets to conquer..
so hug your wife hard, and get back to work
Entire planets are making do with lame, garish themes…
==>jim
Brian,
I love you and I love your site! Thank you! I would like to be able to add a title, like your “What’s On My Mind” … and the date, the “Posted on…” line you have under each stream.
Could you let us know how to do that? I’m using a page rather than category.
thanks so much!
Hi Brian,
Could I have this stream on my WordPress Twenty Eleven theme? This idea is awesome.
Thanks. Leslie Anneliese
While you can register the Stream custom post type on your Twenty Eleven theme, the code that’s in the archive-stream.php file won’t work. With that said, you’d still have everything from the Stream post showing on your page.
Hey Brian,
I’ve added the Stream to my site… So easy to do thanks!.. and managed to edit/style it up a bit with a few hooks thanks to the Studiopress tutorials section.
Question: is there a way to put content before the archive stream? Almost like an intro to the stream you see below but only on the archive page. It would then disappear when you went into each post.
Here’s my example: http://www.paulletourneau.ca/stream/
I also managed to snag the RSS feed from this and set it up to auto tweet when I share a new Stream post. Very cool stuff. Thanks!
Brian, how can I allow comments on the Stream for each post? Is it possible? Be fun to have them.
Thanks!!
Missed screen shot in this tutorial especially how the steam page will look like.
But good tutorial. Enjoyed.
Thanks
I purposely omitted a screenshot because I linked to my own Stream page as an example.
Thanks Brian, a very useful tutorial, successfully added to a client site, with a few changes to suit the need.
I was able to get the stream page into my functions file, but how do I create a new folder in my child theme? Is it through my hosting control panel?
Brian, I finally had the chance to sit down and put your good instructions and great idea into place on my Genesis site. What a terrific idea and the perfect solution for my desire to capture things I’m thinking about without adding them to my blog feed. Ever since Revolution days you’ve offered such value to your readers and customers…I’m grateful to use your products and read your blog. Thank you!
Hey Brian,
Would it be possible to use this as a photo stream?
Say full width with a single image for each post?
I want to add a photo a day stream to my site.
Thanks in advance.
Be Good
Louis
Thanks brain..I have successfully created stream page but how to add twitter stream to the page ???
Don’t think you can do that without some plugin, since the Stream page in this tutorial is entered manually.
This could be gold, indeed.
From my perspective it would be really cool to have post info display like “2 hours ago” and have a custom number of posts to show not the default setting of 10 or whatever you have in Reading settings.
Thanks, Brian. Great stuff!
I don’t know why, the code is not working on my blog. The template is good, yet I see a 404 error when I see the published stream.