Split site title and apply different classes

Figured it out! function split_title($title) { $title = get_bloginfo(‘name’); $word = substr($title, 0 , 5); $press = substr($title, 5); $html = “{$word}<span class=”bold”>{$press}</span>”; return $html; } And then <?php echo split_title($title); ?>

Noindex subscriber author page

The function you want is get_userdata(). Since you need to do this outside the loop, the process is a little less straight-forward. The first thing you need to do is set up a variable called $curauth which is an object that you create by accessing the database by using the $_GET[] superglobal. $curauth = ( … Read more

How to use the checked() function to check for a non-empty var

Not possible. You may do both, but may not be as optimal as single line: $verify = (empty($var)) ? ‘current_value’ : $var; checked( $verify, $current ); Or you can create a custom function: function better_checked($check, $current, $echo = true) { $result=” checked=”checked””; if ( ( $check != ” && $current != ” ) && ( … Read more

wordpress site – using custom database and PHP

Since we do not know how the data should be represented on the ‘front-end’ (read WP install), it is hard to say. You could convert the existing database to use custom tables. Create a small REST(1) JSON/XML(1) API(1) on the ‘other’ application. Then code a WordPress plugin that shows the data from the API with … Read more

Query posts based on previous query

As discussed in the comments, instead of using the ID query argument to get each ‘calp_event’-type post individually, you can pass an array of IDs to post__in in order to grab them all at once, thus reducing the number of database transactions in your code to 2. By creating an array mapping post IDs to … Read more