Connect with us

Tips & Tricks

How to: Show what a user is searching for in the title

Published

on

Want to show what any user was searching for?
It is simple, just add this line where your title would be.

<h1>Browsing search results for <strong>"<?php the_search_query() ?>"</strong>.</h1>

The important line is the_search_query()

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

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

Tips & Tricks

Adding a external file after the first post

Published

on

How might you display a Google ad after the first post or anything you like? It is very simple. You just need to add the variable $loopcounter in the Loop. If the $loopcounter is less than or equal to 1, then include your option. Check out the code:

<?php if (have_posts()) : while (have_posts()) : the_post(); $loopcounter++; ?>

  // your loop

  <?php if ($loopcounter <= 1) { include (STYLESHEETPATH . '/you-file.php'); } ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

Pretty simple huh. Well in the $loopcounter line, you may change the include to point to any file or maybe a custom widget like so:

<?php if ($loopcounter <= 1) { dynamic_sidebar( 'Plus Post' ); } ?>

Or use your code directly in between the { & }.

Continue Reading

Tips & Tricks

A simple way to query posts

Published

on

Here is a simple way to call query_posts with an array of options. For all options you my use visit: WordPress Codex.

<?php $my_query = array('showposts' => 4, 'post__not_in' => $do_not_duplicate); ?>

    <?php query_posts($my_query); ?>
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Dixie D’Amelio: More than Charli’s Sister – The Star on Her Own Stage

Dixie D’Amelio: More than Charli’s Sister – The Star on Her Own Stage

Introduction: Walk Through the Article While Charli D’Amelio might be the name everyone instantly recognizes, Dixie D’Amelio is forging her path, proving she’s not just “Charli’s older sister.” Join us as we journey through the life, achievements, and secrets of Dixie, the songbird and social media sensation who’s just getting started. Dixie D’Amelio: Bio & […]

Emmanuel Hudson Net Worth.

Emmanuel Hudson Net Worth.

Emmanuel Hudson Net Worth Introduction Emmanuel Hudson is a comedian, an actor, an entertainer, and a YouTube star who is only 29 years old. He first started his career in Atlanta, Georgia. He appeared on national TVseveral times, but the root cause of his success was the video he posted in 2012 on YouTube called […]

Nancy Pelosi net worth.

Nancy Pelosi net worth.

What is Nancy Pelosi’s net worth? Nancy Pelosi is an American politician who has a net worth close to 120 million dollars. In one of her recent disclosure of wealth, Nancy and Paul Pelosi, who is her husband, estimated that their total personal wealth falls somewhere in the range of $43 million to $202 million. […]

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 […]

Trending

%d