Skip to content

Instantly share code, notes, and snippets.

/* align button on product page??? */
div.product form.cart .button {
margin-top: 0;
}
#customer_details * {
max-width: 100% !important
}
/* button colors **/
@media (min-width:768px) and (max-width: 1270px) {
.sidebar.widget-area {
margin-top: 100px
}
}
@media (min-width: 768px) {
body .jma-panel-button {
top: 140px;
}
<?php
/**
* Add Read More button below post excerpts/content on archives.
*/
function jma_child_read_more()
{
// only if this is not a singular page.
if (!is_singular()) {
printf('<a href="%s" class="more-link button">%s</a>', get_permalink(), esc_html__('Continue Reading'));
}
@johnnya23
johnnya23 / pattern.php
Created September 12, 2021 21:48
sample pattern code (
<?php
function tabor_register_block_patterns() {
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) {
// $content >>>>> COPY AND PAST FROM LIVE SITE
$content = '<!-- wp:heading {\"align\":\"center\"} -->\n<h2 class=\"has-text-align-center\"><strong>Our approach reflects the people we serve. We are diverse, yet the same.</strong></h2>\n<!-- /wp:heading -->\n\n<!-- wp:buttons {\"align\":\"center\"} -->\n<div class=\"wp-block-buttons aligncenter\"><!-- wp:button {\"borderRadius\":7,\"style\":{\"color\":{\"gradient\":\"linear-gradient(135deg,rgb(0,0,0) 0%,rgb(0,0,0) 50%,rgb(0,0,0) 100%)\"}}} -->\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-background\" style=\"border-radius:7px;background:linear-gradient(135deg,rgb(0,0,0) 0%,rgb(0,0,0) 50%,rgb(0,0,0) 100%)\">Learn More</a></div>\n<!-- /wp:button --></div>\n<!-- /wp:buttons -->\n\n<!-- wp:spacer {\"height\":59} -->\n<div style=\"height:59px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\n<!-- /wp:spacer -->\n\n<!
.jma-sticky-menu .nav > li > a {
transition: all 1s;
}
.jma-sticky-menu.jma-fixed .nav > li > a {
padding-top: 11px !important;
padding-bottom: 11px !important;
}
<?php
function jma_yt_kid_curl($url)
{
$curl = curl_init($url);
//curl_setopt($curl, CURLOPT_SSLVERSION,3);//forMAMP
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
<?php
function JMA_child_admin_enqueue_css_js()
{
$upload = wp_upload_dir();
$upload_dir = $upload['baseurl'];
wp_enqueue_style('childmegamenu', $upload_dir . '/maxmegamenu/style.css');
$output = 'a.mega-menu-link {pointer-events:none!important}';
wp_add_inline_style('childmegamenu', $output);
}
add_action('admin_enqueue_scripts', 'JMA_child_admin_enqueue_css_js');
@johnnya23
johnnya23 / custom.css
Last active February 7, 2022 20:43
Create custom display for native archives
body.archive .post, body.blog .post {
margin: 0;
padding: 1px;
border: none;
}
body.archive .post img, body.blog .post img {
width: 100%;
}
@johnnya23
johnnya23 / jma_child_single_post_link_grid_filter.php
Last active January 5, 2022 12:57
uagb grid with Images, title overlays and custom links
function jma_child_single_post_link_grid($link, $id)
{
if (function_exists('get_field') && get_field('image_link', $id)) {
$link = get_field('image_link', $id);
}
return $link;
}
add_filter("uagb_single_post_link_grid", 'jma_child_single_post_link_grid', 10, 2);
function jma_child_post_alter_attributes($atts, $id)
@johnnya23
johnnya23 / header-cap.css
Last active March 14, 2022 14:16
HTML and CSS for Header Cap w/ ph# & email
@media (min-width: 768px) {
.add-to-panel .wp-block-kadence-column {
-ms-flex-preferred-size: 55% !important;
flex-basis: 55% !important;
}
.add-to-panel .wp-block-kadence-column:first-child {
-ms-flex-preferred-size: 160px !important;
flex-basis: 160px !important;
-ms-flex-negative: 0 !important;