We often have some posts that we would like to promote and keep at the first page of the blog. When you are using pagination, the sticky posts will be added to the standard posts, making the post count per page uneven.
If you want to keep your posts per page count consistent, there is a way to do that.
1 2 3 4 5 6 7 8 9 10 11 |
global $paged; if (!isset($paged) || !$paged){ $paged = 1; } // Set posts per page $posts_per_page = 8; // Get sticky posts $sticky = get_option( 'sticky_posts' ); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// First page and has stickies if($paged == 1 && !empty($sticky)) { $args = array( 'post_type' => 'post', 'paged' => $paged, // Adjust posts per page by subtracting the amount of stickies 'posts_per_page' => $posts_per_page - count($sticky) ); }else{ $args = array( 'post_type' => 'post', 'paged' => $paged, 'posts_per_page' => $posts_per_page, // making sure the 2nd page starts with the right post 'offset' => (($paged-1)*$posts_per_page) - count($sticky) ); } // Do query query_posts($args); |
They built screensiz.es to quickly find the screen specifications of the most popular devices and monitors currently on the market.
Finally identical inputs across different browsers and devices — both desktop and mobile.
iCheck is verified to work in Internet Explorer 6+, Firefox 2+, Opera 9+, Google Chrome and Safari browsers.
Mobile browsers (like Opera mini, Chrome mobile, Safari mobile, Android browser, Silk and others) are also supported. Tested on iOS (iPad, iPhone, iPod), Android, BlackBerry and Windows Phone devices.
We are getting closer to Boostrap 4 and I really love what we are getting with the first alpha version.
Sometimes you want to add your own avatar for a user or build your own special predefined avatar selection :)
BuddyPress stores avatars in /wp-content/uploads/avatars/ – USERID – /
BuddyPress hashes the original filename and stores full and thumbnail images in the above directory.
1 2 3 |
$full_filename = wp_hash( "ORIGINAL-FILENAME" . time() ) . '-bpfull.' . $FILE_EXTENSION; $thumb_filename = wp_hash( "ORIGINAL-FILENAME" . time() ) . '-bpthumb.' . $FILE_EXTENSION; |
Now go ahead and build your own integration around that ;)
I started adding a standard preface to emails from clients asking to work with me. So here it is, for potential new clients, that think about working with me :)
Anything else about me can be read here:
http://www.portalzine.de/services/
http://www.portalzine.de/services/about-alex/
http://www.portalzine.de/services/portfolio/
If you made it so far and you still would like to work with me, we can move to step 2 :)
OS Boxes is a one stop website for all you virtual machine enthusiasts & developers. They provide images for VMWare & Virtualbox.
They offer images for a huge list of Linux distributions and Android X86.
Finally took the time to fine tune my Android Emulator setup, to do some easy browser testing :)
Will be doing an article about browser testing on a local machine soon.
Online browser testing platforms are all nice, but often too expensive for a single developer.
With the ARM translation working, Chrome finally stopped crashing on Android X86 :)
Sadly IE8 is still a browser we need to build for. Sometimes loading a set of local webfonts can break the whole website, as needed resources are not being loaded or timeout.
Best way is to split IE8 webfonts loading from other browsers, by using conditionals:
1 2 3 4 5 6 |
<!--[if lt IE 9]> <link rel="stylesheet" href="fonts.ie.css" type="text/css" media="screen" /> <![endif]--> <!--[if gte IE 9]><!--> <link rel="stylesheet" href="fonts.css" type="text/css" media="screen" /> <!--<![endif]--> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
@font-face { font-family: 'Black'; src: url('black-webfont.eot'); } @font-face { font-family: 'Regular'; src: url('regular-webfont.eot'); } @font-face { font-family: 'Bold'; src: url('bold-webfont.woff.eot'); } |
Only loading the required .EOT files.
Preferences > Advanced > Show Developer menu in menu bar
.