Marc Blase

Match and replace content in WordPress the_title()

In a situation where content in the_title() needed to be italicized.

function fix_the_title( $title ) {

  $new_title = $title;
  $pattern = '/Content to Match/';
  $replace = '<em>$0</em>';
  $new_title = preg_replace($pattern, $replace, $new_title);

  return $new_title;
}
add_filter( 'the_title', 'fix_the_title' );

Add that to functions.php and you’re good.

Published on July 1, 2020

2019 Top Listens

  1. The Black Keys
    291
  2. Sturgill Simpson
    198
  3. Yo La Tengo
    197
  4. Pkew Pkew Pkew
    189
  5. Big K.R.I.T.
    178
  6. Harry Nilsson
    163
  7. Chance the Rapper
    155
  8. Leon Bridges
    153
  9. Maggie Rogers
    149
  10. Michael Bublé
    144
  11. White Denim
    144
  12. PUP
    141
  13. Ol’ Burger Beats
    136
  14. The Beach Boys
    128
  15. Neko Case
    122
  16. Kurt Vile
    116
  17. Big Star
    109
  18. mclusky
    109
  19. Built to Spill
    103
  20. WESTERN SETTINGS
    94
  21. Wilco
    94
  22. Gucci Mane
    93
  23. The Sea and Cake
    91
  24. Twin Peaks
    85
  25. DJ Shadow
    84
  26. Dead Bars
    78
  27. Mac DeMarco
    76
  28. The Modern Lovers
    75
  29. Bleached
    74
  30. The Menzingers
    74
  31. Merle Haggard
    73
  32. Shannon and the Clams
    72
  33. The Beatles
    72
  34. Freddie Gibbs
    71
  35. Nick Drake
    71
  36. James Brown
    69
  37. Nice As Fuck
    68
  38. Guided by Voices
    63
  39. Allah-Las
    61
  40. Teebs
    61
  41. Vince Guaraldi Trio
    61
  42. Jeff Tweedy
    60
  43. The Growlers
    60
  44. Cornelius Brothers & Sister Rose
    56
  45. Françoise Hardy
    56
  46. Jay Som
    56
  47. Miles Davis
    54
  48. emune
    53
  49. Neil Young
    53
  50. John Denver & the Muppets
    50
Published on January 6, 2020

Me on a bike (2019/20 Season)

Race Down Spider Mountain – TTP Season Ender


Want video instead?

Zombie Goat Enduro – Flat Rock Ranch

Dino Enduro – Dino State Park

Redemption Enduro

Published on December 20, 2019

Use .htaccess to remove any query string and redirect to site root

RewriteEngine on
RewriteCond %{QUERY_STRING} .
RewriteRule ^$ /? [R,L]
Published on December 19, 2019

Negative value for margin using calc() in SCSS

Using SCSS and need to set a negative margin with calc on an interpolated variable. Here’s the solution:

.container {
  margin-top: calc((#{$VAR_NAME} + 0px)/-1); // divide by -1 to get a negative result
}
Published on November 18, 2019

Pretty List Item Disc Coloring with SCSS

Since I seem to be asked for these frequently, I am putting this here for quick reference, as well as posterity.

ul {
  list-style: none;
  margin: 0 0 25px;
  padding: 0;
  
  li {
    margin: 0;
    padding: 0 0 0 30px;
    text-indent: -15px;

    &::before {
      content: "• ";
      color: gold; // it's a pretty color
    }
  }
}
Published on November 6, 2019

Get list of installed programs with PowerShell in Windows

In PowerShell run:

To get a list of installed programs:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize > c:\Users\YOUR_USER\Documents\list-installed-programs.txt

To get a list of app store installed programs:

Get-AppxPackage | Select Name, PackageFullName |Format-Table -AutoSize > c:\Users\YOUR_USER\Documents\list-installed-programs.txt

NOTE: Yes, this is all over the internet, but I wanted it here so I could find it faster next time.

Published on October 15, 2019

Pool/Spa Cooling Formula

As I’ve had use of this in the past I am putting it here for future reference.

PI = (V/1000) * DCD * 43.75

Where:
PI = Pounds of ice required
V = Volume of water in gallons
DCD = Degrees Cooling Desired; Current – Desired temp in °F

Note: Not sure where the 43.75 constant comes from. Will update if/when I find a source.

Note 2: This is of interest and could be used to rework the above formula: http://www.hk-phy.org/contextual/heat/cha/la_he07_e.html

Published on September 3, 2019

Random Character Formula for Calc

=CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))
Published on April 25, 2019

Me on a bike (2018/19 Season)

Zombie Goat Enduro

Dino Enduro

Hill Country Eagle Enduro

O’Rock Epic Enduro

Shiner GASP 2019


Wife


Bro

Published on March 29, 2019