Commit 2aea0abe authored by Benthe Kuijpers's avatar Benthe Kuijpers
Browse files

replaced button url/text fields with link field

parent c9601b0c
...@@ -59,38 +59,18 @@ ...@@ -59,38 +59,18 @@
}, },
{ {
"key": "field_604102a087c61", "key": "field_604102a087c61",
"label": "Button text", "label": "Button",
"name": "button_text", "name": "button",
"type": "text", "type": "link",
"instructions": "", "instructions": "",
"required": 0, "required": 0,
"conditional_logic": 0, "conditional_logic": 0,
"wrapper": { "wrapper": {
"width": "50", "width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_604102ae87c62",
"label": "Button URL",
"name": "button_url",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "", "class": "",
"id": "" "id": ""
}, },
"default_value": "", "return_format": "array"
"placeholder": ""
}, },
{ {
"key": "field_6040ff70ae542", "key": "field_6040ff70ae542",
...@@ -549,38 +529,18 @@ ...@@ -549,38 +529,18 @@
}, },
{ {
"key": "field_604644414a152", "key": "field_604644414a152",
"label": "Text link (text)", "label": "Text link",
"name": "text_link", "name": "text_link",
"type": "text", "type": "link",
"instructions": "", "instructions": "",
"required": 0, "required": 0,
"conditional_logic": 0, "conditional_logic": 0,
"wrapper": { "wrapper": {
"width": "50", "width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_604644564a153",
"label": "Tekst link (URL)",
"name": "text_link_url",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "", "class": "",
"id": "" "id": ""
}, },
"default_value": "", "return_format": "array"
"placeholder": ""
} }
] ]
} }
...@@ -611,5 +571,5 @@ ...@@ -611,5 +571,5 @@
"hide_on_screen": "", "hide_on_screen": "",
"active": true, "active": true,
"description": "", "description": "",
"modified": 1615218150 "modified": 1615401697
} }
\ No newline at end of file
...@@ -40,4 +40,24 @@ function current_menu_item_for_archives($menu) { ...@@ -40,4 +40,24 @@ function current_menu_item_for_archives($menu) {
} }
return $menu; return $menu;
} }
add_filter( 'nav_menu_css_class', 'current_menu_item_for_archives', 10,2 ); add_filter( 'nav_menu_css_class', 'current_menu_item_for_archives', 10,2 );
\ No newline at end of file
add_action('wp_dashboard_setup', 'mio_custom_dashboard_widgets');
function mio_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Make It Open - website manual', 'mio_dashboard_widget');
}
function mio_dashboard_widget() {
echo '<a href="' . home_url() . '"><img src="' . get_template_directory_uri() . '/assets/img/make-it-open-logo.svg" width="100%" style="margin:0 0 20px"></a>';
echo '<strong>Welcome to the Make It Open CMS!</strong>';
echo '<p>Here is a list quick links to edit this site:</p>';
echo '<li><a href="' . admin_url() . '/post-new.php">Add a news article</a></li>';
echo '<li><a href="' . admin_url() . '/post-new.php?post_type=page">Add a new page</a></li>';
echo '<li><a href="' . admin_url() . '/post-new.php?post_type=resources">Add a new resource</a></li>';
echo '<li><a href="' . admin_url() . '/post-new.php?post_type=events">Add a new event</a></li>';
echo '<li><a href="' . admin_url() . '/post.php?post=2&action=edit">Change the homepage</a></li>';
echo '<li><a href="' . admin_url() . '/nav-menus.php">Change the menu</a></li>';
echo '<li><a href="' . admin_url() . '/admin.php?page=acf-options-footer">Change the footer</a></li>';
}
\ No newline at end of file
...@@ -13,12 +13,15 @@ $blend_mode = get_sub_field('img_blend_mode'); ...@@ -13,12 +13,15 @@ $blend_mode = get_sub_field('img_blend_mode');
<? } ?> <? } ?>
<div class="text-wrapper"> <div class="text-wrapper">
<?php echo get_sub_field('content'); <?php echo get_sub_field('content');
$button_text = get_sub_field('button_text');
$button_url = get_sub_field('button_url');
if ($button_text && $button_url) { $button = get_sub_field('button');
echo '<a href="' . $button_url . '" class="btn">' . $button_text . '</a>'; if( $button ):
} ?> $btn_url = $button['url'];
$btn_title = $button['title'];
$btn_target = $button['target'] ? $button['target'] : '_self';
echo '<a href="' . esc_url( $btn_url ) . '" target="' . esc_attr( $btn_target ) . '" class="btn">' . esc_html( $btn_title ) . '</a>';
endif;
?>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -17,11 +17,18 @@ $layout = get_sub_field('layout'); ...@@ -17,11 +17,18 @@ $layout = get_sub_field('layout');
<div class="item__content"> <div class="item__content">
<h3><?php the_sub_field('title'); ?></h3> <h3><?php the_sub_field('title'); ?></h3>
<?php the_sub_field('description'); <?php the_sub_field('description');
$link = get_sub_field('text_link'); $link = get_sub_field('text_link');
$url = get_sub_field('text_link_url'); if( $link ):
if ($link && $url) { $link_url = $link['url'];
echo '<a href="' . $url . '" target="_blank" class="text-link text-link--external">' . $link . '</a>'; $link_title = $link['title'];
} ?> $link_target = $link['target'] ? $link['target'] : '_self';
echo '<a href="' . esc_url( $link_url ) . '" target="' . esc_attr( $link_target ) . '" class="text-link ';
if ($link_target === '_blank') {
echo 'text-link--external';
}
echo '">' . esc_html( $link_title ) . '</a>';
endif; ?>
</div> </div>
</div> </div>
<?php endwhile; ?> <?php endwhile; ?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment