An easy way to create widgets in WordPress
First: Require the WP_Widget_Ex
class.
require_once get_template_directory() . '/inc/wp_widget_ex.php';
angular.module("app.directives", []) | |
.directive("pagination", function($location){ | |
return { | |
restrict: 'A', | |
link: function($scope, element, attrs) { | |
function getInt (val){ | |
return parseInt(String(val).replace(/[^0-9]+/, '')); | |
} |
ul { | |
list-style: none; | |
padding: 0; | |
margin: 0 0 0 20px; | |
li { | |
padding-left: 1em; | |
text-indent: -1.8em; | |
margin-bottom: 10px; |
<?php | |
/** | |
* Embed SoundCloud. | |
* | |
* @param string $url The URL of the audio in SoundCloud. | |
* @return string Returns the IFRAME tag. | |
*/ | |
function embed_soundcloud($url) | |
{ |
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
module.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
}); | |
grunt.registerTask('default', []); | |
// grunt.registerTask('install', ['composer:update', 'bower:install', 'sprite:s1', 'copy', 'concat', 'replace']); |
Install.
composer require phpoffice/phpexcel
<?php | |
function clean_value($value, $format = '') | |
{ | |
if (is_array($value)) | |
{ | |
foreach ($value as $k => $v) | |
{ | |
$value[$k] = clean_value($v, $format); | |
} |
<VirtualHost *:80> | |
DocumentRoot "D:/webdev" | |
ServerName localhost | |
ServerAlias 127.0.0.1 | |
<Directory "D:/webdev"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Require local | |
</Directory> |
<?php | |
add_action('admin_notices', function() | |
{ | |
$plugin_messages = array(); | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
$required_plugins = [ | |
'wordpress-seo/wp-seo.php' => 'Yoast SEO', |