Skip to content

Instantly share code, notes, and snippets.

View interactiveRob's full-sized avatar

Rob Kirkner interactiveRob

View GitHub Profile
@interactiveRob
interactiveRob / search.php
Last active February 9, 2021 19:34 — forked from galengidman/search.php
WordPress search form & results for custom post type
<?php
// check to see if there is a post type in the URL
if ( isset( $_GET['post_type'] ) && $_GET['post_type'] ):
$filtered_posts = new WP_Query( array(
'post_type' => $_GET['post_type'],
'posts_per_page' => 12,
'orderby' => 'post_date',
's' => $_GET['s'],
));
@interactiveRob
interactiveRob / echo-enqueued-styles-scripts-wordpress.php
Created March 28, 2022 17:57 — forked from omurphy27/echo-enqueued-styles-scripts-wordpress.php
Wordpress - Print Out All Enqueued Scripts And Styles On A Page
<?php
// add the below to your functions file
// then visit the page that you want to see
// the enqueued scripts and stylesheets for
function se_inspect_styles() {
global $wp_styles;
echo "<h2>Enqueued CSS Stylesheets</h2><div>";
foreach( $wp_styles->queue as $handle ) :