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
jQuery(document).ready(function() | |
{ | |
jQuery("#order_comments").attr('maxlength','140'); // make sure to change the 140 number here to match the number after remaining below | |
countdownCharacters(); | |
jQuery('#order_comments').change(updateCountdown); | |
jQuery('#order_comments').keyup(updateCountdown); | |
}); | |
function countdownCharacters() { | |
// 140 is the max message length | |
var remaining = 140 - jQuery('#order_comments').val().length; |
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
<?php | |
/* | |
Plugin Name: Strip Shortcodes | |
Description: Strip shortcodes from home/blog posts page | |
*/ | |
function strip_shortcode_from_excerpt( $content ) { | |
if ( is_home() ) { | |
$content = strip_shortcodes( $content ); | |
} | |
return $content; |
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
/* Resize hover text area for screen sizes smaller than 480px wide. Repeat for other screen sizes as needed */ | |
@media only screen and (max-width: 480px) { | |
.hover-text { | |
width: 261px; | |
height: 192px; | |
display: none; | |
margin-top: -201px; | |
margin-left: 13px; | |
} | |
.widget-4:focus .hover-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
/* Replace the width and height values with your image's width and height */ | |
/* You may need to play with the margin-top and margin-left values to get the hover effect lined up exactly over your image */ | |
.hover-text { | |
width: 250px; | |
height: 184px; | |
display: none; | |
margin-top: -193px; | |
margin-left: 13px; | |
} | |
/* This uses a black background with 75% opacity, and white text that is aligned in the center. Adjust as necessary. */ |
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
// We want to know the widget-4 part below. Yours will likely be a different number depending on where your widget is in the widget area. | |
<div class="widget-4 widget-even widget-wrap"> |
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
<!-- Replace http://yoursite.com/link-to-a-page with the actual link to the page you want to link to --> | |
<a href="http://yoursite.com/link-to-a-page"> | |
<!-- Replace http://yoursite.com/wp-content/uploads/2016/02/your-image.jpg with the actual image URL --> | |
<img src="http://yoursite.com/wp-content/uploads/2016/02/your-image.jpg" alt="" /> | |
<div class="hover-text">The text you want to display</div> | |
</a> |
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
Private Sub LicenseKeyDeactivate_Click() | |
If license.Value = "" Then | |
MsgBox "Please enter a license key.", vbExclamation, "Input Data" | |
Exit Sub | |
Else | |
Application.ScreenUpdating = False | |
With ThisWorkbook.Worksheets("Sheet1").Range("A1") | |
.Cells(1, 1).Value = license.Value |
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
Private Sub LicenseKeyActivate_Click() | |
'license.Value is what the user entered into the text box on the UserForm. | |
If license.Value = "" Then | |
MsgBox "Please enter a license key.", vbExclamation, "Input Data" | |
Exit Sub | |
Else | |
Application.ScreenUpdating = False | |
With ThisWorkbook.Worksheets("Sheet1").Range("A1") | |
.Cells(1, 1).Value = license.Value |
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
Private Sub Workbook_Open() | |
httpRequestCheck | |
With ThisWorkbook.Worksheets("Sheet1").Range("A1") | |
' the And .Cells(4, 1) = 0 is probably redundant, and if you are allowing more than one activation per license key you should remove that part. | |
If .Cells(3, 1).Value = "valid" And .Cells(4, 1) = 0 And .Cells(5, 1) <> "in_use" Then | |
'call your add-in here | |
Else | |
'if the license is not valid, the number of activations remaining is greater than 0, and it is not in use elsewhere we should display the license activation UserForm. | |
Activate_License | |
End If |
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
Sub Activate_License() | |
'Show the license key activation UserForm (mine is creatively named LicenseKey) | |
LicenseKey.Show | |
End Sub |