Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The template for displaying the Add/edit classified page.
* You can override this file in your active theme.
*
* @license GNU General Public License (Version 2 - GPLv2) {@link http://www.gnu.org/licenses/gpl-2.0.html}
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'No direct access allowed!' );
}
<?php /*
Plugin Name: Jobs & Experts Custom Job Fields
Author: Hoang Ngo
Version: 1.0
*/
<?php /*
Plugin Name: Jobs & Experts Custom Job Fields
Author: Hoang Ngo
Version: 1.0
*/
add_action( 'admin_menu', 'ms_mailchim_admin_menu', 99 );
function ms_mailchim_admin_menu() {
add_submenu_page( 'membership2', __( "Mailchimp Subscribe" ), __( "Mailchimp Subscribe" ), 'manage_options', 'ms-mailchimp-subsribe', 'ms_mailchim_exec' );
}
function ms_mailchim_exec() {
?>
<div class="wrap">
<form method="post">
<input type="text" name="list_id" placeholder="Mailchimp list id">
<?php
/**
* The Template for displaying all single posts.
*
* @package ThinkUpThemes
*/
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
@vodanh1213
vodanh1213 / gist:db95a566ab6b29bea666
Created July 2, 2015 15:49
Recent post global shortcode
add_shortcode( 'global_recent_posts', 'global_recent_posts_sc' );
function global_recent_posts_sc( $atts ) {
$data = wp_parse_args( $atts, array(
'order' => '',
'orderby' => '',
'is_meta' => 0,
'post_type' => 'post',
'post_status' => 'publish',
'recentglobalpostsdisplay' => 'title_content',
'recentglobalpostsnumber' => '5',
@vodanh1213
vodanh1213 / gist:26f55104b17ab6bf699c
Created July 2, 2015 15:49
Recent post global shortcode
add_shortcode( 'global_recent_posts', 'global_recent_posts_sc' );
function global_recent_posts_sc( $atts ) {
$data = wp_parse_args( $atts, array(
'order' => '',
'orderby' => '',
'is_meta' => 0,
'post_type' => 'post',
'post_status' => 'publish',
'recentglobalpostsdisplay' => 'title_content',
'recentglobalpostsnumber' => '5',
@vodanh1213
vodanh1213 / gist:f82ffc82e2cf6c4fd400
Created July 2, 2015 15:37
Recent post global shortcode
add_shortcode( 'global_recent_posts', 'global_recent_posts_sc' );
function global_recent_posts_sc( $atts ) {
$atts = wp_parse_args( $atts, array(
'order' => 'ASC',
'orderby' => 'post_title',
'is_meta' => 0,
'post_type' => 'post',
'post_status' => 'publish',
'recentglobalpostsdisplay' => 'title_content',
'recentglobalpostsnumber' => '5',
!function(){function t(t){"closed"===r?t._show()?(s=t,r="open"):e(t):u[u.length]=t}function e(){if(r="closed",s=null,u.length>0){var e=u.shift();t(e)}}function o(t,e,o){var n,p,d=0,r=i(window.location.toString()),u=i(document.referrer.toString()),s=null,c=function(e){s=jQuery.extend({},t),s.popup=e,a(s)};return void 0!==window.force_popover&&(d=window.force_popover.toString()),void 0!==e&&(d=e.toString()),t.ajax_data=t.ajax_data||{},p=jQuery.extend({},t.ajax_data),p.action="inc_popup",p["do"]=t["do"],p.thefrom=r,p.thereferrer=u,d&&(p.po_id=d),o&&(p.data=o),t.preview&&(p.preview=!0),n={url:t.ajaxurl,dataType:"jsonp",jsonpCallback:"po_data",data:p,success:function(t){c(t)},complete:function(){jQuery(document).trigger("popup-load-done",[s])}},jQuery.ajax(n)}function a(t){if(void 0!==t){var e=function(t){void 0!==t&&(void 0!==t.popup&&void 0!==t.popup.html&&(jQuery('<style type="text/css">'+t.popup.styles+"</style>").appendTo("head"),jQuery(t.popup.html).appendTo("body").hide()),window.inc_popup=new d(t),window.i
add_shortcode('list_domains_wpmu', 'list_domains_wpmu');
function list_domains_wpmu($attrs = array())
{
$default = array(
'root_domain' => parse_url(get_site_url(1), PHP_URL_HOST)
);
$a = wp_parse_args($attrs, $default);
$domains = get_site_option('md_domains');
$data = array();
foreach ($domains as $domain) {