Skip to content

Instantly share code, notes, and snippets.

@bronwynv
bronwynv / custom_post_types.php
Created March 19, 2017 03:27 — forked from Kelderic/custom_post_types.php
This is set of helper classes to create and manage custom post types for WordPress. It gets added to a theme's logic folder, or libs or includes folders, and included in functions.php. Then the primary tracker class is initiated once, and used to create new CTPs.
<?php
/***********************************************************************/
/*************************** TRACKER CLASS ***************************/
/***********************************************************************/
class Custom_Post_Types_Manager {
public $ctp_slugs;
public $prefix;
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 365 -out %domain%\server.crt
echo.
echo -----
@bronwynv
bronwynv / google-analytics-track-anchors.txt
Last active January 12, 2021 01:07
Gtag.js track URLS with anchor links
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXX-Y', {
'page_path': location.pathname + location.search + location.hash
});
@bronwynv
bronwynv / archive-books.php
Created August 25, 2020 19:35 — forked from About2git/archive-books.php
Single and Archive templates for Custom Post Type in Genesis
<?php
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove entry meta in entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@bronwynv
bronwynv / gist:bab423a8e362e93d642d92c1d122f2a5
Created March 12, 2024 14:58
Keep OptinMonster 2 columns on smaller screens.
@media screen and (max-width: 768px) {
html div#om-{{id}} .{{ns}}-row-content.Row__content div {
flex-direction: row !important;
}
html div#om-{{id}} .{{ns}}-column.{{ns}}-col-1.Column.om-column.optin-left-column-class {
display: inline-block !important;
width: 30% !important; /* adjust percentage */
}
html div#om-{{id}} .{{ns}}-column.{{ns}}-col-2.Column.om-column.optin-right-column-class {
display: inline-block !important;
@bronwynv
bronwynv / gist:5fdc57bb0773c796b3a7236ac563f925
Created March 22, 2024 12:32
Persist landing page query args during current session while browsing to other pages
<script>
// Function to parse query parameters from URL
function getQueryParams(url) {
const queryParams = {};
const urlParams = new URLSearchParams(url.search.slice(1));
for (const [key, value] of urlParams.entries()) {
queryParams[key] = value;
}
return queryParams;
}
@bronwynv
bronwynv / gist:6e6d2d52392271cdb76f37abf27c78d9
Created April 18, 2024 12:16
OptinMonster - keep 2 columns in responsive campaign on mobile devices
@media screen and (max-width: 768px) {
html div#om-{{id}} .{{ns}}-row-content.Row__content div {
flex-direction: row !important;
}
html div#om-{{id}} .{{ns}}-column.{{ns}}-col-1.Column.om-column.optin-left-column-class,
html div#om-{{id}} .{{ns}}-column.{{ns}}-col-2.Column.om-column.optin-right-column-class {
display: inline-block !important;
}
}