Display post title and content in wordpress theme

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <br /> <?php the_content(); endwhile; endif; ?>
Continue reading…

Enjoyed this post? Share it!

 
 

Common template tags in wordpress

the_permalink() — Displays the URL of your post. the_title() — Displays the title of the post. the_ID() — Displays the unique ID of your post. the_content() — Displays the full content of your post. the_excerpt() — Displays the excerpt of your post. If the Excerpt field is filled out on the Post edit screen, that […]
Continue reading…

Enjoyed this post? Share it!

 
 

Permalink structure in wordpress

1 . By default, WordPress URLs aren’t rewritten so as to avoid compatibility problems with non-Apache servers, and look like this: http: //www.w3mentor.com/blog/?p=1522 2. To modify your blog permalink structure, carry out the following steps: Login to your WordPress dashboard. Go to Settings | Permalinks. Select the permalink structure you’d like to use, or enter […]
Continue reading…

Enjoyed this post? Share it!

 
 

Highlight featured sticky posts in wordpress

edToolbar() Insert the following code inside the Loop, after a call to the_post.   <div class="sticky-post-class"> <p>This post is sticky.</p> </div> cialis for sale edCanvas = document.getElementById(‘content’);   Last edited by admin on August 15, 2010 at 8:55 pm HeatMap Theme Pro – SEO Meta Description Meta Keywords SEO Text More Text HeatMap Theme Pro […]
Continue reading…

Enjoyed this post? Share it!

 
 

Remove posts with a certain tag from the Loop in wordpress

edToolbar() Add the following to functions.php. add_action(’pre_get_posts’, ‘remove_tag_from_loops’); function remove_tag_from_loops( $query ) { if(!$query-&gt;get(’suppress_filters’)) { //replace tag1 by th<div><a href=’http://1buycheapcialisonline.com/’ title=’buy cheap generic cialis online’>buy cheap generic cialis online</a></div>e slug for the tag to be hidden $tag_id = get_term_by(’name’,’tag1′,’post_tag’)-&gt;term_id; $excluded_tags = $query-&gt;get(’tag__not_in’); if(is_array( $excluded_tags )) { $excluded_tags[] = $tag_id; } else { $excluded_tags = array($tag_id); […]
Continue reading…

Enjoyed this post? Share it!

 
 

Hide posts from a certain category in WordPress

edToolbar() Insert the following code into functions.php. add_action(’pre_get_posts’, ‘remove_cat_from_loops’); function remove_cat_from_loops( $query ) { if(!$query-&gt;get(’suppress_filters’)) { //add cate<div><a href=’http://buyviagra.name/’ title=’buy generic viagra’>buy generic viagra</a></div>gory name below. $cat_id = get_cat_ID(’Category Name’); $excluded_cats = $query-&gt;get(’category__not_in’); if(is_array($excluded_cats)) { $excluded_cats[] = $cat_id; } else { $excluded_cats = array($cat_id); } $query-&gt;set(’category__not_in’, $excluded_cats); } return $query; } edCanvas = document.getElementById(‘content’); Â […]
Continue reading…

Enjoyed this post? Share it!

 
 

Displaying ads after every x posts in wordpress

Add the following to template file like index.php or category.php. <h2></h2> <div><a href="http://canadianpharmacy-bestrxstore.com">canadian pharmacy percocet</a> – <a href="http://cialisonline-bestrxpharmacy.com">compare cost viagra levitra cialis</a> – <a href="http://genericviagra-rxbeststore.com">viagra no effect</a> – <a href="http://cialisonline-bestrxpharmacy.com">cialis daily for sale</a> – <a href="http://genericviagra-rxbeststore.com">what an over the counter viagra</a></div> &lt;?php // Display content $ad_counter = $ad_counter % $after_every; if( 0 == $ad_counter ) […]
Continue reading…

Enjoyed this post? Share it!

 
 

Iterate through the available posts in wordpress and display titles

edToolbar() <h2></h2> edCanvas = document.getElementById(‘content’); buy viagra online  Last edited by admin on August 15, 2010 at 8:29 pm HeatMap Theme Pro – SEO Meta Description Meta Keywords SEO Text More Text HeatMap Theme Pro – Recent Posts Plus Widget .questionmark { background: url(“http://w3mentor.com/wp-content/themes/hmtpro5/images/preset-images/questionmark.gif”) repeat scroll 0 0 transparent; display: inline-block; height: 13px; width: […]
Continue reading…

Enjoyed this post? Share it!