…deoThe ternary operator allows us to simplify some PHP conditional statements. We'll see how it can be used, with test-driven development and refactoring, to simplify code like:<?php $result = null; if (5>3) { $result = "Bigger"; } else { $result = "Less"; }Written using a ternary operator, we can write…
…detect whether your code is running in a monthly archive page, the Conditional Tag is_month() will help you. Accepted Parameters This Conditional Tag doesn't accept any parameters. 28. Checking the Current Theme's Features: current_theme_supports() While developing plugins, you might need to check whether the active theme allows thumbnails, post formats,…
…ded by WordPress to do just this, styling the posts on your main blog page by category.What You'll NeedTo follow this tutorial, you'll need: a development installation of WordPress a code editor If you already have a theme you want to use this technique in, you'll be working on your…
…derstandable. While the responsibility of implementing a lot of these recommendations lies with the plugin or theme's 'end user' (or whoever is publishing the content), there are recommendations that the developers of those plugins and themes can implement.Readable (3.1)The first guideline states that content should be "readable and understandable". A…
…delete existing blogs. In this session, we are going to build some groundwork for those functions, making a list view of blogs in the admin page and adding a router (if you don't know what a router is, this session is for you). 1. Create and Render BlogsAdminViewStep 1: HTML…
…Designing a Cart PageWe'll be using Bootstrap to design our page. Once we are done with our Bootstrap designed page, we'll integrate it into our AngularJS application. While designing the page we won't go into much details of Bootstrap, but we'll focus on some critical points.Create a page called index.html.…
…delete post functionality in the welcome page. In this part of the tutorial, we'll add a Ladda loading indicator into our application. Adding a loading indicator is quite essential as it makes the application more interactive. We'll also fix a couple of minor issues as the tutorial progresses.Getting StartedLet's start…
…developing for WordPress Multisite, eventually there will come a time when you need to detect the main site. The Conditional Tag is_main_site will help you then: It determines whether the given site ID is the main site of the network. Accepted Parameters This Conditional Tag has only one parameter: $site_id…
…Developer Edition was released by Mozilla during the tenth anniversary celebration of Firefox last year. Recently, 64-bit builds of Firefox Developer Edition have also been made available for Windows, Linux and Mac OS X. Firefox Developer Edition provides easy accessibility for a wide array of developer tools which help in…
…detect when any post type is being displayed. It's basically a combination of the Conditional Tags is_single(), is_attachment() and is_page(). Plus, if you set a post type (or an array of post types) as the parameter, you can detect only the post types you set. Accepted Parameters This Conditional Tag…