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 | |
add_filter( 'rest_api_allowed_post_types', 'allow_my_post_types'); | |
function allow_my_post_types($allowed_post_types) { | |
$allowed_post_types[] = 'portfolio'; | |
return $allowed_post_types; | |
} | |
?> |
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 | |
// Disable the admin bar on mobiles but enable on desktops | |
function cornerstone_show_admin_bar() { | |
if( wp_is_mobile() || !is_user_logged_in() ) { | |
return false; | |
} else { | |
return true; | |
} | |
} |
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 | |
$pageChildren = get_pages('child_of='.$post->ID."&echo=0&post_type=custompostypename"); | |
if ( $pageChildren ) { | |
foreach ( $pageChildren as $pageChild ) { | |
echo '<a href="' . get_permalink($pageChild->ID) . '">'; | |
$childimage = wp_get_attachment_image_src(get_post_thumbnail_id($pageChild->ID), 'thumbnail_size'); | |
$childimagealttext = get_post_meta(get_post_thumbnail_id($pageChild->ID), '_wp_attachment_image_alt', true); | |
echo '<img src="'. $childimage['0'] . '" alt="' . $childimagealttext . '"/></a>'; | |
echo '<p><a href="' . get_permalink($pageChild->ID) . '">'. $pageChild->post_title.'</a></p>'; | |
} |
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 | |
add_action( 'after_setup_theme','remove_cornerstone_features', 100 ); | |
function remove_cornerstone_features() { | |
remove_action( 'init', 'Orbit'); | |
} | |
?> |
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 if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
echo 'This is the last post'; | |
} ?> | |
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
echo 'This is the not the last post'; | |
} ?> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="uk.co.thewirelessguy.myappname" > | |
<application | |
android:allowBackup="true" | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > | |
<activity |
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
let primaryIconsDictionary = NSBundle.mainBundle().infoDictionary?["CFBundleIcons"]?["CFBundlePrimaryIcon"] as? NSDictionary | |
let iconFiles = primaryIconsDictionary!["CFBundleIconFiles"] as! NSArray | |
let lastIcon = iconFiles.lastObject as! NSString //last seems to be largest, use first for smallest | |
let theIcon = UIImage(named: lastIcon as String) | |
let iconImageView = UIImageView(image: theIcon) |
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 mytheme_setup() { | |
add_theme_support('custom-logo'); | |
} | |
add_action('after_setup_theme', 'mytheme_setup'); |
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
// | |
// GetAppIcon.swift | |
// | |
// Get the AppIcon from Assets and return it as a UIImage | |
// Created by Stephen Mullen | |
// | |
import UIKit | |
func getAppIcon() -> UIImage { |
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 | |
# Create new Magento admin user programmatically. | |
require_once('./app/Mage.php'); | |
umask(0); | |
Mage::app(); | |
try { | |
$user = Mage::getModel('admin/user') | |
->setData(array( | |
'username' => 'admin1', |
OlderNewer