heading and cta styles
This commit is contained in:
@@ -2382,7 +2382,7 @@
|
||||
"name": "copy",
|
||||
"aria-label": "",
|
||||
"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,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
@@ -2391,6 +2391,7 @@
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"allow_in_bindings": 1,
|
||||
"tabs": "all",
|
||||
"toolbar": "full",
|
||||
"media_upload": 1,
|
||||
@@ -8574,5 +8575,5 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"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>
|
||||
* @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(
|
||||
'(([^/]+/)*blog)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[3]',
|
||||
'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');
|
||||
|
||||
function update_post_link( $post_link, $id = 0 ) {
|
||||
function update_post_link($post_link, $id = 0)
|
||||
{
|
||||
$post = get_post($id);
|
||||
if (is_object($post) && $post->post_type == 'post') {
|
||||
return home_url('/blog/' . $post->post_name . '/');
|
||||
}
|
||||
return $post_link;
|
||||
}
|
||||
|
||||
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') {
|
||||
$skip_redirect = true;
|
||||
}
|
||||
|
||||
return $skip_redirect;
|
||||
}
|
||||
|
||||
@@ -273,29 +276,53 @@ add_action( 'wp_head', 'gtm_output', 2 );
|
||||
add_action('wp_footer', 'gtm_datalayer_init', 10);
|
||||
add_action('body_top', 'gtm_noscript_output');
|
||||
|
||||
function gtm_output() { ?>
|
||||
<!-- Google Tag Manager -->
|
||||
function gtm_output()
|
||||
{
|
||||
?><!-- Google Tag Manager -->
|
||||
<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],
|
||||
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);
|
||||
})(window,document,'script','dataLayer','GTM-MJH5WQQ');</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
|
||||
<?php
|
||||
<!-- End Google Tag Manager --><?php
|
||||
}
|
||||
|
||||
function gtm_noscript_output() { ?>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
function gtm_noscript_output()
|
||||
{
|
||||
?><!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MJH5WQQ"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
|
||||
<?php
|
||||
<!-- End Google Tag Manager (noscript) --><?php
|
||||
}
|
||||
|
||||
function gtm_datalayer_init() {?>
|
||||
<script>window.dataLayer = window.dataLayer || [];</script>
|
||||
|
||||
<?php
|
||||
function gtm_datalayer_init()
|
||||
{
|
||||
?><script>window.dataLayer = window.dataLayer || [];</script><?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