Skip to content

Instantly share code, notes, and snippets.

@omurphy27
omurphy27 / echo-enqueued-styles-scripts-wordpress.php
Last active March 8, 2024 07:19
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><ul>";
foreach( $wp_styles->queue as $handle ) :
echo "<li>" . $handle . "</li>";
@omurphy27
omurphy27 / Open-link-in-new-window-and-print-js-javascript.js
Created August 5, 2015 20:30
JS / HTML open Link to Image in New Window and Print Image
@omurphy27
omurphy27 / wp_query_woocommerce_product_category.php
Last active November 9, 2023 23:05
Wordpress WP_Query in WooCommerce for a Product Category aka Taxonomy which is ordered by a Custom Field
<?php
$args = array(
'posts_per_page' => 7,
'post_type' => 'product',
'product_cat' => 'home-featured',
'meta_key' => 'home_featured_order',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
@omurphy27
omurphy27 / transparent background image pattern overlay.css
Created March 26, 2013 04:59
CSS Transparent Background Image Pattern Overlay
/*Transparent pattern placed over an image, like we see on the bootstrap homepage: http://twitter.github.com/bootstrap/index.html*/
div {
width: 200px;
height: 200px;
display: block;
position: relative;
background: url(images/background-image.png);
}
@omurphy27
omurphy27 / WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
Last active September 10, 2022 04:21
WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
<?php
// add core markup to woocommerce pages
add_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
// overwrite existing output content wrapper function
function woocommerce_output_content_wrapper() {
echo '<div class="main-bg no-top-banner">
<div class="container">
<div id="content" class="row" >
<div id="main" class="col-md-9 pull-right clearfix" >';
@omurphy27
omurphy27 / Gravity Forms WP CSS Honeypot styling.css
Last active June 20, 2022 02:10
Gravity Forms WP CSS Honeypot styling.css
.gform_validation_container,
.gform_wrapper .gform_validation_container,
body .gform_wrapper li.gform_validation_container,
body .gform_wrapper .gform_body ul.gform_fields li.gfield.gform_validation_container,
body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container {
display: none !important;
position: absolute !important;
left: -9000px;
}
@omurphy27
omurphy27 / Styling Logo and hiding logo text.css
Created March 13, 2013 04:04
HTML CSS Styling Logo Image and Hiding Logo Text
/*Here's the html for the logo
<div class="header">
<h1 class="logo" ><a href="" >Magazine</a></h1>
</div>
Here's the CSS for the Logo*/
.header h1.logo { margin: 7px 0 0 0; float: left; }
@omurphy27
omurphy27 / Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML.php
Last active September 16, 2021 05:52
Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML
<?php if( have_rows('tabs') ): ?>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?>
<?php
$string = sanitize_title( get_sub_field('tab_title') );
?>
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> >
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a>
</li>
<?php $i++; endwhile; ?>
@omurphy27
omurphy27 / Google My Maps Embed Change Zoom Level .html
Created February 18, 2015 19:03
Google My Maps Embed - Change Zoom Level
// Google Maps change zoom level
// just append &amp;z=15 at the end of src url
<iframe src="https://www.google.com/maps/d/embed?mid=zFZSXubrjIbQ.kTtvWjBE06QI&amp;z=15" width="640" height="480"></iframe>
@omurphy27
omurphy27 / Fixed header gets transparent when scrolling down.js
Created February 25, 2013 01:15
JQUERY - Fixed header gets tranparent when scrolling down
// Jquery make a fixed header become transparent as you scroll down
// and revert to not transparent when you scroll back up
// here is a url with more details: http://stackoverflow.com/questions/2921186/scroll-function-jquery
(function() {
var $header = $('#navbar');
$(window).scroll(function () {