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
/*-----------------------------------------------------------------------------------------------------// | |
Filters wp_title to print a neat <title> tag based on what is being viewed. | |
/*-----------------------------------------------------------------------------------------------------*/ | |
function organic_wp_title( $title, $sep ) { | |
global $page, $paged; | |
if ( is_feed() ) | |
return $title; |
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
/*-----------------------------------------------------------------------------------------------------// | |
Comments Function | |
-------------------------------------------------------------------------------------------------------*/ | |
if ( ! function_exists( 'organicthemes_comment' ) ) : | |
function organicthemes_comment( $comment, $args, $depth ) { | |
$GLOBALS['comment'] = $comment; | |
switch ( $comment->comment_type ) : | |
case 'pingback' : | |
case 'trackback' : |
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 photographer_content_width() { | |
if ( ! is_single() || is_active_sidebar( 'post-sidebar' ) ) { | |
global $content_width; | |
$content_width = 900; | |
} | |
if ( ! is_home() || is_archive() || is_active_sidebar( 'blog-sidebar' ) ) { | |
global $content_width; | |
$content_width = 900; | |
} | |
if ( ! is_page() || is_active_sidebar( 'page-sidebar' ) ) { |
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
/* | |
* Enable selective refresh for widgets. | |
*/ | |
add_theme_support( 'customize-selective-refresh-widgets' ); |
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 | |
function organic_profile_block_editor_assets() { | |
// Scripts. | |
wp_enqueue_script( | |
'organic-profile-block', // Handle. | |
plugins_url( 'block.js', __FILE__ ), // Block.js: We register the block here. | |
array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above. | |
filemtime( plugin_dir_path( __FILE__ ) . 'block.js' ) // filemtime — Gets file modification time. | |
); |
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 | |
function organic_profile_block_block_assets() { | |
// Styles. | |
wp_enqueue_style( | |
'organic-profile-block-frontend', // Handle. | |
plugins_url( 'style.css', __FILE__ ), // Block frontend CSS. | |
array( 'wp-blocks' ), // Dependency to include the CSS after it. | |
filemtime( plugin_dir_path( __FILE__ ) . 'style.css' ) // filemtime — Gets file modification time. | |
); | |
wp_enqueue_style( |
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 (blocks, editor, components, i18n, element) { | |
// Our custom block code. | |
})( | |
window.wp.blocks, | |
window.wp.editor, | |
window.wp.components, | |
window.wp.i18n, | |
window.wp.element |
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 (blocks, editor, components, i18n, element) { | |
var el = wp.element.createElement | |
var registerBlockType = wp.blocks.registerBlockType | |
var RichText = wp.editor.RichText | |
var BlockControls = wp.editor.BlockControls | |
var AlignmentToolbar = wp.editor.AlignmentToolbar | |
var MediaUpload = wp.editor.MediaUpload | |
var InspectorControls = wp.editor.InspectorControls | |
var TextControl = components.TextControl | |
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
registerBlockType('organic/profile-block', { // The name of our block. Must be a string with prefix. Example: my-plugin/my-custom-block. | |
title: i18n.__('Profile'), // The title of our block. | |
description: i18n.__('A custom block for displaying personal profiles.'), // The description of our block. | |
icon: 'businessman', // Dashicon icon for our block. Custom icons can be added using inline SVGs. | |
category: 'common', // The category of the block. | |
attributes: { // Necessary for saving block content. | |
title: { | |
type: 'array', | |
source: 'children', | |
selector: 'h3' |
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
edit: function (props) { | |
var attributes = props.attributes | |
var alignment = props.attributes.alignment | |
var facebookURL = props.attributes.facebookURL | |
var twitterURL = props.attributes.twitterURL | |
var instagramURL = props.attributes.instagramURL | |
var linkedURL = props.attributes.linkedURL | |
var emailAddress = props.attributes.emailAddress | |
var onSelectImage = function (media) { |
OlderNewer