Skip to content

Instantly share code, notes, and snippets.

View ScarletPonytail's full-sized avatar

ScarletPonytail ScarletPonytail

View GitHub Profile
@ScarletPonytail
ScarletPonytail / gist:6ea2508183d2731ae06568236e48bdcc
Last active June 8, 2017 14:15
Magento - Execute PHP code in cms
{{block type="core/template" template="path/to/template.phtml"}}
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'admin';
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxYk1TzDhOzJlI$lIGH)', 256), ':xxxxxxxx:1') WHERE username = 'admin';
@ScarletPonytail
ScarletPonytail / gist:6aa7456d6e9f69f4cb5e82df840ff994
Last active January 10, 2018 15:56
CSS - Background Cover Image
background: url(images/bg.jpg) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@ScarletPonytail
ScarletPonytail / text.txt
Last active March 21, 2017 15:01
Wordpress - Captcha Shortcode
// Contact Form 7 reCAPTCHA
[recaptcha]
// Really Simply Captcha Plugin
<p>To prove your humanity, please enter the text in the box.</p>
<p>[captchac captcha-157][captchar captcha-157]</p>
@ScarletPonytail
ScarletPonytail / text.txt
Last active June 8, 2017 14:16
Wordpress - Contact Form 7 Template Shortcode for php template file
<?php echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' ); ?>
@ScarletPonytail
ScarletPonytail / gist:e53b50601b693891fd6a21e376ecfe30
Last active September 14, 2018 11:55
Wordpress - Home URL PHP Code
<?php echo esc_url( get_site_url() ); ?>
<?php echo esc_url( home_url() ); ?>
@ScarletPonytail
ScarletPonytail / page-home.php
Last active June 12, 2017 14:16
Wordpress - If-Page
<!-- Using page name -->
<?php
if (is_page( 'Wine Investment')) {
get_template_part( 'carousel-wine-investment' );
}
?>
<!-- Using page id -->
<?php
if (is_page( 42 )) {
@ScarletPonytail
ScarletPonytail / footer.php
Last active March 20, 2019 15:45
Wordpress - Get Menu
@ScarletPonytail
ScarletPonytail / gist:c1fc31a9a9f0ca1c58ab8872b2b164e7
Created February 24, 2017 13:30
Wordpress - Page.php / Standard Code
<?php get_header(); ?>
<div class="container theme-showcase" role="main">
<section id="content" role="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="header">
<h1 class="entry-title"><?php the_title(); ?></h1> <?php edit_post_link(); ?>
</header>
@ScarletPonytail
ScarletPonytail / gist:cbeb173be9a83b1f6a75d5fe15fe6389
Created February 24, 2017 13:31
Wordpress - Pull Page Content into Theme
<?php $id=47; $post = get_page($id); echo $post->post_content; ?>