Promote your Service and Product online Contact us

+91 87 44 999667; +91 99 11 883996 info@3pixls.com, sales@3pixls.com

Display Your Most Popular Posts In the Last 30 Days Without a Plugin

June 6th, 2016 by

[php] <div class="col-md-12"> <div class="custom-heading02"> <h2>Trending Articles</h2> </div><!– .custom-heading02 end –> <?php function filter_where($where = ”) { //posts in the last 30 days $where .= " AND post_date > ‘" . date(‘Y-m-d’, strtotime(‘-30 days’)) . "’"; return $where; } add_filter(‘posts_where’, ‘filter_where’); query_posts(‘post_type=post&posts_per_page=10&orderby=comment_count&order=DESC’); while (have_posts()): the_post(); ?> <div class="col-md-6 col-sm-12"> <a href="<?php the_permalink() ?>"><?php the_post_thumbnail( ‘medium’, […]

WordPress Tag Design

June 3rd, 2016 by

use this code for show Tag without comma [php] <div class="tagsContainer"> <?php if (get_the_tags()) :?> <p class="tags">Tags: <?php the_tags(”, ‘ ‘, ”); ?></p> <?php endif;?> </div> [/php] and use this code for show Tag without comma [php] <?php the_tags( ‘Tags: ‘, ‘, ‘, ‘ ‘ ); ?> [/php] Css class [css] .tagsContainer { margin: 20px […]

Change WP default sub menu class

May 27th, 2016 by

In WordPress, all sub-menus have the class ‘sub-menu’. To change it to a custom class, add the following code in your functions.php file. [php] function change_submenu_class($menu) { $menu = preg_replace(‘/ class="sub-menu"/’,’/ class="myclass" /’,$menu); return $menu; } add_filter(‘wp_nav_menu’,’change_submenu_class’); [/php]

Limit Access to Designated IP Addresse

May 9th, 2016 by

[php] <?php $allow = array("192.168.0.103", "45.120.124.38", "789.123.456"); if(!in_array($_SERVER[‘REMOTE_ADDR’], $allow) && !in_array($_SERVER["HTTP_X_FORWARDED_FOR"], $allow)) { $retry = 60 * 60; // = 60 minutes header("HTTP/1.1 503 Service Unavailable"); header("Retry-After: $retry"); echo " <h1>Site update in progress – Please return in 60 minutes!</h1> "; exit(); } ?>[/php]

Set Default Thumbnail, Featured Image WordPress

April 28th, 2016 by

[php] <?php the_permalink() ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src="<?php bloginfo(‘template_directory’); ?>/images/youtubethumb.png" alt="<?php the_title(); ?>" /> <?php } ?> [/php]


Warning: Undefined variable $additional_loop in /home/pixlscom/public_html/blog/wp-content/themes/3pixelsblog/index.php on line 34

Warning: Attempt to read property "max_num_pages" on null in /home/pixlscom/public_html/blog/wp-content/themes/3pixelsblog/index.php on line 34