heading and cta styles
This commit is contained in:
@@ -2382,7 +2382,7 @@
|
|||||||
"name": "copy",
|
"name": "copy",
|
||||||
"aria-label": "",
|
"aria-label": "",
|
||||||
"type": "wysiwyg",
|
"type": "wysiwyg",
|
||||||
"instructions": "To add button style for a link add class=\"button--primary\" to anchor tag.",
|
"instructions": "To add button style for a link add class=\"button--primary\" to anchor tag.\r\nOr, after creating the link, highlight it and choose from the Formats section.\r\nTo add different heading styles add class=\"h1\" class=\"h2\" etc...",
|
||||||
"required": 0,
|
"required": 0,
|
||||||
"conditional_logic": 0,
|
"conditional_logic": 0,
|
||||||
"wrapper": {
|
"wrapper": {
|
||||||
@@ -2391,6 +2391,7 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
|
"allow_in_bindings": 1,
|
||||||
"tabs": "all",
|
"tabs": "all",
|
||||||
"toolbar": "full",
|
"toolbar": "full",
|
||||||
"media_upload": 1,
|
"media_upload": 1,
|
||||||
@@ -8574,5 +8575,5 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"modified": 1736974944
|
"modified": 1737662796
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,7 +217,8 @@ function populate_SESSpromotion_description($value) {
|
|||||||
* @author Golden Oak Web Design <info@goldenoakwebdesign.com>
|
* @author Golden Oak Web Design <info@goldenoakwebdesign.com>
|
||||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GPLv2+
|
* @license https://www.gnu.org/licenses/gpl-2.0.html GPLv2+
|
||||||
*/
|
*/
|
||||||
function blog_generate_rewrite_rules( $wp_rewrite ) {
|
function blog_generate_rewrite_rules($wp_rewrite)
|
||||||
|
{
|
||||||
$new_rules = array(
|
$new_rules = array(
|
||||||
'(([^/]+/)*blog)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[3]',
|
'(([^/]+/)*blog)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[3]',
|
||||||
'blog/([^/]+)/?$' => 'index.php?post_type=post&name=$matches[1]',
|
'blog/([^/]+)/?$' => 'index.php?post_type=post&name=$matches[1]',
|
||||||
@@ -249,20 +250,22 @@ function blog_generate_rewrite_rules( $wp_rewrite ) {
|
|||||||
|
|
||||||
add_action('generate_rewrite_rules', 'blog_generate_rewrite_rules');
|
add_action('generate_rewrite_rules', 'blog_generate_rewrite_rules');
|
||||||
|
|
||||||
function update_post_link( $post_link, $id = 0 ) {
|
function update_post_link($post_link, $id = 0)
|
||||||
|
{
|
||||||
$post = get_post($id);
|
$post = get_post($id);
|
||||||
if (is_object($post) && $post->post_type == 'post') {
|
if (is_object($post) && $post->post_type == 'post') {
|
||||||
return home_url('/blog/' . $post->post_name . '/');
|
return home_url('/blog/' . $post->post_name . '/');
|
||||||
}
|
}
|
||||||
return $post_link;
|
return $post_link;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter('post_link', 'update_post_link', 1, 3);
|
add_filter('post_link', 'update_post_link', 1, 3);
|
||||||
|
|
||||||
function skip_redirect( $skip_redirect, $post_id, $post ) {
|
function skip_redirect($skip_redirect, $post_id, $post)
|
||||||
|
{
|
||||||
if ($post->post_type === 'post') {
|
if ($post->post_type === 'post') {
|
||||||
$skip_redirect = true;
|
$skip_redirect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $skip_redirect;
|
return $skip_redirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,29 +276,53 @@ add_action( 'wp_head', 'gtm_output', 2 );
|
|||||||
add_action('wp_footer', 'gtm_datalayer_init', 10);
|
add_action('wp_footer', 'gtm_datalayer_init', 10);
|
||||||
add_action('body_top', 'gtm_noscript_output');
|
add_action('body_top', 'gtm_noscript_output');
|
||||||
|
|
||||||
function gtm_output() { ?>
|
function gtm_output()
|
||||||
<!-- Google Tag Manager -->
|
{
|
||||||
|
?><!-- Google Tag Manager -->
|
||||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
})(window,document,'script','dataLayer','GTM-MJH5WQQ');</script>
|
})(window,document,'script','dataLayer','GTM-MJH5WQQ');</script>
|
||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager --><?php
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function gtm_noscript_output() { ?>
|
function gtm_noscript_output()
|
||||||
<!-- Google Tag Manager (noscript) -->
|
{
|
||||||
|
?><!-- Google Tag Manager (noscript) -->
|
||||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MJH5WQQ"
|
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MJH5WQQ"
|
||||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||||
<!-- End Google Tag Manager (noscript) -->
|
<!-- End Google Tag Manager (noscript) --><?php
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function gtm_datalayer_init() {?>
|
function gtm_datalayer_init()
|
||||||
<script>window.dataLayer = window.dataLayer || [];</script>
|
{
|
||||||
|
?><script>window.dataLayer = window.dataLayer || [];</script><?php
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_filter('mce_buttons', function ($buttons) {
|
||||||
|
return array_merge(['styleselect'], $buttons);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Attach callback to 'tiny_mce_before_init'
|
||||||
|
add_filter('tiny_mce_before_init', function ($init_array) {
|
||||||
|
$init_array['style_formats'] = wp_json_encode([
|
||||||
|
[
|
||||||
|
'title' => 'CTA Primary',
|
||||||
|
'selector' => 'a',
|
||||||
|
'classes' => ['button--primary'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'CTA Secondary',
|
||||||
|
'selector' => 'a',
|
||||||
|
'classes' => ['btn', 'btn-secondary'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'CTA Tertiary',
|
||||||
|
'selector' => 'a',
|
||||||
|
'classes' => ['btn', 'btn-outline-primary'],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
// die(var_dump($init_array));
|
||||||
|
return $init_array;
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user