Skip to content

Instantly share code, notes, and snippets.

@AndreaBarghigiani
Last active January 2, 2020 09:07
Show Gist options
  • Save AndreaBarghigiani/e23fba8ab754c36d0cfb5d1e01abe8a8 to your computer and use it in GitHub Desktop.
Save AndreaBarghigiani/e23fba8ab754c36d0cfb5d1e01abe8a8 to your computer and use it in GitHub Desktop.
Raccolta di codici per azionare l'onboarding nei temi Genesis: https://skillsandmore.org/onboarding-genesis/
<?php
// Array di configurazione
return [
'dependencies' => [
'plugins' => [],
],
'content' => [],
'navigation_menus' => [],
'widgets' => [],
];
<?php
// Installazione di plugin.
return [
'dependencies' => [
'plugins' => [
[
'name' => __( 'WooCommerce', 'genesis-sample' ),
'slug' => 'woocommerce/woocommerce.php',
'public_url' => 'https://woocommerce.com/',
],
[
'name' => __( 'SEO by Yoast', 'genesis-sample' ),
'slug' => 'wordpress-seo/wp-seo.php',
'public_url' => 'https://yoast.com/wordpress/plugins/seo/',
],
[
'name' => __( 'Social Warfare', 'genesis-sample' ),
'slug' => 'social-warfare/social-warfare.php',
'public_url' => 'https://warfareplugins.com/products/social-warfare/',
],
],
],
'content' => [],
'navigation_menus' => [],
'widgets' => [],
];
<?php
// Aggiungo del contenuto.
return [
'dependencies' => [
'plugins' => [],
],
'content' => [
'homepage' => [
'post_tilte' => 'Homepage',
'post_content' => require dirname( __FILE__ ) . '/import/content-home.php', // File importato
'post_type' => 'page',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'closed',
'meta_input' => [
'_genesis_layout' => 'full-width-content',
// Altre configurazioni.
],
],
],
'navigation_menus' => [],
'widgets' => [],
];
<?php
$sam_dev_homepage_content = <<<CONTENT
<!-- wp:paragraph -->
<p>Non dovrebbe essere un segreto, su SkillsAndMore apprezziamo veramente molto il framework Genesis. </p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Lo apprezziamo talmente tanto che abbiamo pubblicato un <a href="https://skillsandmore.org/corso/installa-gestisci-genesis-pro/" target="_blank" rel="noreferrer noopener" aria-label="corso dedicato (opens in a new tab)">corso dedicato</a> al suo utilizzo e <a rel="noreferrer noopener" aria-label="manteniamo uno starter theme (opens in a new tab)" href="https://github.com/skillsAndMore/sam-genesis-dev-starter" target="_blank">manteniamo uno starter theme</a> pieno di chicche dedicate allo sviluppatore.</p>
<!-- /wp:paragraph -->
CONTENT;
return $sam_dev_homepage_content;
<?php
// Posizionamento e attivazione widget.
return [
'dependencies' => [
'plugins' => [],
],
'content' => [],
'navigation_menus' => [],
'widgets' => [
'footer-1' => [
[
'type' => 'featured-post',
'args' => [
'title' => 'Featured Posts Example',
'posts_cat' => '0',
'posts_num' => 3,
'posts_offset' => '0',
'orderby' => 'date',
'order' => 'DESC',
'gravatar_size' => '45',
'gravatar_alignment' => 'alignnone',
'image_size' => 'thumbnail',
'image_alignment' => 'alignnone',
'show_title' => '1',
'show_byline' => '1',
'post_info' => '[post_date] By [post_author_posts_link] [post_comments]',
'show_content' => 'excerpt',
'content_limit' => '0',
'more_text' => '[Read More...]',
'extra_title' => '',
'extra_num' => '',
'more_from_category_text' => 'More Posts from this Category',
],
],
],
],
];
...
array (
'title' => 'Ciao Mondo!',
'text' => 'Semplice widget di testo aggiunta direttamente in bacheca.',
'filter' => true,
'visual' => true,
),
...
<?php
// Array configurazione widget text.
$new_instance = wp_parse_args(
$new_instance,
array(
'title' => '',
'text' => '',
'filter' => false, // For back-compat.
'visual' => null, // Must be explicitly defined.
)
);
<?php
// Creazione menu di navigazione.
return [
'dependencies' => [
'plugins' => [],
],
'content' => [],
'navigation_menus' => [
'primary' => [
'homepage' => [
'title' => 'Home',
],
'contact' => [
'title' => 'Contattaci',
],
],
],
'widgets' => [],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment