Editable content blocks, is there an easier way?
-
Alright, here’s what my website currently looks like: https://collegian.csufresno.edu/. It is not powered by Word Press yet, as I’m still trying to figure out how to do it. I want to use Word Press as a CMS.
As you can see the page is split up into several areas I like to call content blocks. There’s “News,” “Sports,” “Drop Box,” “Opinion,” “Features,” “Video Stories,” “Podcasts,” “Blogs,” “Today’s Front Page,” “Alcohol on Campus,” “Polls,” etc. Each of these content blocks needs to be editable.
My idea is to make each of the content blocks a category in Word Press. Then make a static index page using many, many loops to call each content block to the page. Here’s the code I’d use:
<?php $posts = get_posts( “category=X&numberposts=X” ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <?php the_title(); ?> <?php the_content(); ?> <?php endforeach; ?> <?php endif; ?>
Is this a good idea? Or is there a better way to do this? Any advice would be much appreciated as I’m still new to Word Press. Thanks!
- The topic ‘Editable content blocks, is there an easier way?’ is closed to new replies.