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 | |
/* | |
* List popular posts by comment count | |
* This function used for Genesis custom theme, May be work with any theme. | |
*/ | |
function m3_popular_posts(){ | |
$args = array( | |
'no_found_rows' => 1, | |
'post_status' => 'publish', | |
'orderby' => 'comment_count', |
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
/* | |
* List of recent posts | |
*/ | |
function m3_last_posts(){ | |
$args = array( | |
'no_found_rows' => 1, | |
'post_status' => 'publish', | |
'posts_per_page' => 5 | |
); | |
$latest_posts = new WP_Query( $args ); |
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
/* | |
* List the related posts by current post tags. | |
*/ | |
function m3_related_posts(){ | |
$tags = wp_get_post_tags($post->ID); | |
if ($tags) { | |
echo 'Related Posts'; | |
$first_tag = $tags[0]->term_id; | |
$args=array( | |
'tag__in' => array($first_tag), |
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 | |
class Wedding | |
{ | |
protected $start; | |
protected $end; | |
public function __construct($start = '2013-04-22 09:45', $end = '2013-04-22 10:15') | |
{ | |
$this->start = $start; |
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/sh | |
# WP-CLI Template | |
# @see http://wp-cli.org/ | |
# install | |
curl http://wp-cli.org/installer.sh | bash |
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
.PHONY: install | |
install: clean wordpress phpunit wp-cli | |
git submodule init; | |
@echo "\n\nNOTICE: You may need to configure a MySQL database for your Wordpress installation. Just run:" | |
@echo " mysql -u root -p;" | |
@echo " CREATE DATABASE example_site; \n" | |
wordpress: latest.tar.gz | |
tar -zxvf latest.tar.gz; |
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 | |
# this is a work in progress! NOT for production. | |
# requires wp-cli | |
# usage: wp-base-install | |
# or: ./wp-base-install.sh | |
# Bits of inspiration from https://gist.github.com/2853221 | |
# to look at: http://www.servercobra.com/automated-wordpress-install-with-nginx-script/ |
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 | |
/** | |
* Course_Tree is a PHP class that provides an implementation of the modified preorder tree traversal algorithm making | |
* it easy for you to use MPTT in your PHP applications. | |
* | |
* It provides methods for adding nodes anywhere in the tree, deleting nodes, moving and copying nodes around the tree | |
* and methods for retrieving various information about the nodes. | |
* | |
* Course_Tree uses {@link http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html MySQL transactions} making |
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 | |
/* | |
I've managed to get Pligg to use WordPress authentication and user database. | |
I recently got Pligg using Pubcookie and that formed the basis of this work, however they are very different. | |
I've only tested this with Pligg. I believe future versions may have a better approach for external authentication so I can't guarantee this will work with future versions. | |
This approach is very "hacky". I've also been slightly lazy. It assumes that you will use WordPress' login, logout and register pages. This will break the existing login, logout and register forms in Pligg. The ultimate solution would allow the Pligg forms to login and logout also on WordPress and the register form to create new users in WordPress. |
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 | |
/* | |
* 1. create wp plugin for pligg | |
* 2. create file wpconnect.php at pligg root | |
*/ | |
$pligg_url = ''; | |
$pligg_path = ''; | |
/* |
OlderNewer