Skip to content

Instantly share code, notes, and snippets.

View ScarletPonytail's full-sized avatar

ScarletPonytail ScarletPonytail

View GitHub Profile
@ScarletPonytail
ScarletPonytail / footer.php
Created April 11, 2017 14:38
HTML - jQuery Slide Out Tab
@ScarletPonytail
ScarletPonytail / header.php
Created April 11, 2017 10:51
WordPress - If Parent page and Child of parent page
elseif ( is_page( '59' ) || '59' == $post->post_parent ) { // About
$post = get_post();
get_template_part( 'carousel-about' );
}
@ScarletPonytail
ScarletPonytail / functions.php
Created April 11, 2017 09:22
WordPress - Blog only showing particular category
// Blog only showing particular category
function my_home_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '7'); } }
add_action( 'pre_get_posts', 'my_home_category' );
@ScarletPonytail
ScarletPonytail / page-home.php
Last active September 6, 2017 09:52
WordPress - Blog Post Elements / Adding slide image based on Featured Image for page / Except / Date / Author
// User this just to call the image that's the featured image for that page surrounded by the 'img tag
<?php echo get_the_post_thumbnail(); ?>
// If you want more control over the size of the image
<?php echo get_the_post_thumbnail( get_the_ID(), 'full' ); ?>
// If statement for Thumbnail
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(array(120,120)); // Declare pixel size you need inside the array ?>
@ScarletPonytail
ScarletPonytail / page-category.php
Last active June 8, 2017 14:09
WordPress - Blog on 'Page'
<?php
/*
Template Name: Press & Media Blog
*/
?>
<?php get_header(); ?>
<div class="container">
<h1>Press &amp; Media</h1>
<p>Members of our team have been interviewed by international and UK media to explain the dynamics of the fine wine market and the treatment of fine wine as an alternative asset for investment purposes.</p>
@ScarletPonytail
ScarletPonytail / text
Last active September 27, 2017 12:56
WordPress - Plugins
For contact forms:
- Ninja Forms (By The WP Ninjas)
- reCAPTCHA for Ninja Forms (Aman Saini)
- Contact Form 7 (By Takayuki Miyoshi)
- Contact Form 7 Honeypot (Nocean)
- Contact Form 7 - reCAPTCHA (By iambriansreed)
- Invisible reCaptcha for WordPress - (By Mihai Chelaru)
- Bootstrap for Contact Form 7 (By Felix Arntz)
@ScarletPonytail
ScarletPonytail / _menu.scss
Last active June 8, 2017 14:09
CSS - Bootstrap Burger Override unhide sooner
// Burger Overrides
// ----------------------------------
@media (min-width: 768px) and (max-width: 892px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
@ScarletPonytail
ScarletPonytail / list.phtml
Created April 3, 2017 14:32
Magento - Remove white border from small images on category grid
// Replace this...
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
// ...with this.
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
@ScarletPonytail
ScarletPonytail / text
Last active June 8, 2017 14:09
WordPress - Resolve an "500 Internal Server Error"
This is likely to occur AFTER you have increased the file upload threashold. To resolve this, go to: Settings > Permalinks and click 'Save'. This will rewrite the htaccess file and resolve the error.
// No access to Admin?
01. Disable the 'wps-hide-login' plugin by renaming it.
02. Go to: Settings > Permalinks and click 'Save'. This will rewrite the htaccess file and resolve the error.
03. Enable the 'wps-hide-login' plugin.
04. Login
@ScarletPonytail
ScarletPonytail / functions.php
Created March 30, 2017 11:23
WordPress - Add Favicon to functions.php
// Add Favicon
function vinx_favicon() {
echo '<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" />';
}
add_action('wp_head', 'vinx_favicon');