Connect with us

Tips & Tricks

Can′t add pagination on WooThemes Thick Theme

Published

on

Everything I have tried has led to nothing. And I have tried six way’s from Sunday to get my main posts to paginate.

example one:

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
query_posts('offset=1&showposts=' . get_option('woo_other_entries') . '&cat=-' . $GLOBALS['ex_asides'] . '&paged=$paged' ); ?>

example two:

<?php 
global $myOffset; 
global $wp_query;
$myOffset = 1;
$paged = intval(get_query_var('paged')) ? get_query_var('paged') : 1;
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query(array(
	'offset' => $myOffset,
	'category__not_in' => array($GLOBALS['ex_asides'],7,84),
	'paged' => $paged,
	'showposts' => get_option('woo_other_entries'),
	)); ?>

example three:

<?php 
global $myOffset;
$myOffset = 1;
$wp_query = new WP_Query();
$wp_query->query(array(
	'offset' => $myOffset,
	'category__not_in' => array($GLOBALS['ex_asides'],7,84),
	'paged' => $paged,
	'showposts' => get_option('woo_other_entries'),
	)); ?>

And after those tries, I just can’t get more pages beyond the option’s that I choose, and can only pull an archive via the browse more link.

Any suggestions or anything?

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Tips & Tricks

Remove spaces when echoing the_title

Ever wanted to print or echo the WordPress title attribute without spaces?

Published

on

This little trick can be useful for calling custom functions and printing the title with out spaces for W3C compatibility. I used this trick in a new theme called Galleria, which will be out for public download in the coming days.

Using this comes in handy for a delicious text link:

<?php $title = get_the_title(); ?>
<a href="http://del.icio.us/post?url=<?php echo $title; ?>&amp;<?php echo str_replace(" ", "%20", $title); ?>">
Bookmark This (<?php echo $title; ?>)</a>

What I am doing is calling $title = get_the_title(); and using str_replace(" ", "%20", $title); to replace empty spaces with a %20, which is used in URL encoding empty spaces.

Alternatively you can use a dash or underscore.

Thanks to Jason Boyle for his adaption.

Continue Reading

Tips & Tricks

Display the_excerpt only if there is text

Have you ever wanted to display the excerpt only if you write one? A simple couple lines of code can display the_excerpt any where you like.

Published

on

In my new theme, I am using this coded trick to display the excerpt on a single post only if I’ve got text inside. Usually if you use the_excerpt and you don’t have one, it will fake one for you.

This is not something that I wanted to do on the single post page. So I used the following code to check if the excerpt existed.

if ( !empty( $post->post_excerpt ) ) :

Once this action is taken into account, you can factor in what code you want to out put if the post_excerpt isn’t empty.

if ( !empty( $post->post_excerpt ) ) :
	the_excerpt();
else :
	false;
endif;

The above code checks if there is an excerpt and print’s it to the screen. If there isn’t an except, it doesn’t do anything.

Continue Reading

Tips & Tricks

Add a shortcode

Published

on

This is a simple one.

/**
 * Your Blog title
 *
 */
function my_blog_title() {
	$blogname = get_bloginfo('name');
    return '<span class="blog-title">' . $blogname . '</span>';
}		  	
add_shortcode('blog-title', 'my_blog_title');

Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title. :)

Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Faze banks Net Worth: How Rich is Faze Banks Actually?

Faze banks Net Worth: How Rich is Faze Banks Actually?

Ricky Banks, who is better known as Faze Banks, is an American Youtuber and the co-owner of the most subscribed gaming group of Call of Duty called Faze Clan which has more than 7 million subscribers. Moreover, his own channel has close to 5.5 million subscribers. Moreover, he is also credited for the formation of […]

Steve Easterbrook Net Worth: How Rich is the Former McDonald’s CEO?

Steve Easterbrook Net Worth: How Rich is the Former McDonald’s CEO?

Steve Easterbrook is an English business executive. He is the former chief executive of McDonald’s where he served from March 2015 to November 2019. As of 2019, Steve Easterbrook net worth is estimated to be $40 million. Easterbrook was born on August 6, 1967, in Watford, England. He went to Watford Grammar School for Boys. […]

Mattia Polibio Height, Net Worth, Biography & Other Facts

Mattia Polibio Height, Net Worth, Biography & Other Facts

Mattia Polibio Biography Mattia Polibio is a young TikTok star who has been able to successfully garner well over 2 million followers on his profile with close to 120 million likes on his videos so far because of his videos that include duets as well as lip-syncs of popular songs. Poliobio was born on May […]

24kGoldn Net Worth: How Rich is the Upcoming Rapper Actually?

24kGoldn Net Worth: How Rich is the Upcoming Rapper Actually?

24KGoldn is a young American rapper. He is best known for his track called “Valentino” which would be a song about wanting money over love. This song was able to make it to the Billboard Hot 100 and even garnered popularity on TikTok videos. He is currently signed with the record labels LLC and Columbia. […]

Trending