This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//15 is the amount of words & change three dots to whatever you want at the end of the excerpt | |
<?php echo wp_trim_words( get_the_excerpt(), 15, '...' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jp_custom_image( $media, $post_id, $args ) { | |
if ( $media ) { | |
return $media; | |
} else { | |
$permalink = get_permalink( $post_id ); | |
$url = apply_filters( 'jetpack_photon_url', 'https://example.com/wp-content/uploads/2017/07/example-image.jpg' ); | |
return array( array( | |
'type' => 'image', | |
'from' => 'custom_fallback', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Read More link to Excerpt | |
function new_excerpt_more($more) { | |
global $post; | |
return '… <a href="'. get_permalink($post->ID) . '">' . 'Read More »' . '</a>'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register a custom image size for Singular Featured images | |
//Choose custom image size and remember to Regenerate Thumbnails | |
add_image_size( 'singular-featured-thumb', 768, 450, true ); | |
//Hook to add image before entry content | |
add_action( 'genesis_before_entry_content', 'tm_display_featured_image' ); | |
//Function to display image | |
function tm_display_featured_image() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Adding custom Favicon */ | |
add_filter( 'genesis_pre_load_favicon', 'custom_favicon' ); | |
function custom_favicon( $favicon_url ) { | |
return 'http://example.com/wp-content/uploads/favicon.png'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Change default search text | |
function themeprefix_search_button_text( $text ) { | |
return ( 'Custom search phrase...'); | |
} | |
add_filter( 'genesis_search_text', 'themeprefix_search_button_text' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import smtplib | |
import getpass | |
def send_email(): | |
# create message object instance | |
msg = MIMEMultipart() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# specify your MFA_DEVICE_ARN | |
MFA_DEVICE_ARN=YOURMFAARN | |
PATH_TO_CREDENTIALS_FILE=/path/to/.aws/credentials | |
echo $PATH_TO_CREDENTIALS_FILE | |
#1H = 3600 | |
#2H = 7200 | |
#3H = 10800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#ver. 4 | |
##this script will check mysql and apache | |
##if that service is not running | |
##it will start the service and send an email to you | |
##if the restart does not work, it sends an email and then exits | |
##set the path ##this works for Ubuntu 14.04 and 16.04 | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipelines: | |
branches: | |
master: | |
- step: | |
name: Deploy to staging | |
deployment: staging | |
script: | |
- pipe: atlassian/sftp-deploy:0.5.7 | |
variables: | |
USER: $SFTP_USERNAME |
OlderNewer