wordpress
Output specific post from a category in Wordpress
Let's say you slice a website and need a nicely looking block in a sidebar with one recent post from certain category. Like in case with this one below: Daily Style Quote.
Logically following you need to run "the loop" and ask Wordpress for just one post from just this particular category.
Here we go:
<div id="dailyStyleQuote"> <div id="quoteText"> <?php query_posts('category_name=Daily Style Quote&posts_per_page=1'); ?> <?php while (have_posts()) : the_post(); the_content(''); ?> </div> <div id="quoteBottom"> <?php the_time('l, F j, Y'); ?> <?php $category_id = get_cat_ID( 'Daily Style Quote' ); $category_link = get_category_link( $category_id ); ?> <a href="<?php echo $category_link; ?>">archive</a> </div> <?php endwhile; ?> </div>
Page permalinks in Wordpress
Got myself puzzled for a bit while slicing a Wordpress theme this weekend on how to get a permalink to a certain page in Wordpress template, given that you know what's page title. Use this:
<?php echo get_permalink(get_page_by_title("Page title here")->ID); ?>
So now in your template you can use like this:
<a href="<?php echo get_permalink(get_page_by_title("About")->ID); ?>">About</a>
Wordpress: drop-down pages menu with jQuery magic
Using Wordpress as a content management system (CMS) for a web site is a great idea. You get both - static content via Pages and blog entries via Posts. However one may ask - how do you put it all together, given that some sites require drop-down menus?
About
Advertisment
Latest tweets
- New post: Ichi Umi - awesome sushi buffet in Midtown New York City http://bit.ly/cQ1Wch #buffet #midtown #nyc 3 days ago
- New post: Hulu Plus for PS3 and Samsung TV - a sad review http://bit.ly/9PmZd2 #hulu #huluplus #ps3 6 days ago
- New post: How to rent a cheap apartment in New York City http://bit.ly/aX98yP #craigslist #nyc #rent 2 weeks ago
- New post: Killing inner creativity with full time job http://bit.ly/bj6Ht3 #freelance #job 2 weeks ago
- I actually know a few ppl who were quite inspired to spin their own biz after working for a year or two at Apple... I wonder why #apple #job 3 weeks ago
Recent works / current clients
- BellatAuto Inc - New York / New Jersey used car auto dealer: design and coding.
- Colette Maison Lumiere - multimedia artist: design and coding for the CMS.
- Complete Body & Spa - New York City personal training and gym management company: Wordpress template coding.
- DaleStyle Blog Dale Sudakoff’s fashion blog: Wordpress template coding.
- DoctorKalitenko.COM - Sergey Kalitenko : antiaging hollistic doctor performing bioidentical replacement therapy. CMS coding and design.
- Great Jones Spa - premiere New York City Day Spa: coded and designed website and storefront
