-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_profile-page.php
52 lines (39 loc) · 1.69 KB
/
page_profile-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php /* Template Name: Profile Page Template */
beans_add_smart_action( 'beans_before_load_document', 'human_droid_profile_setup_document' );
function human_droid_profile_setup_document() {
beans_remove_attribute('beans_main_grid', 'class', 'uk-panel uk-panel-box uk-panel-space');
beans_add_attribute('beans_post', 'class', 'tm-profile-main uk-overlay');
beans_add_attribute('beans_post_header', 'class', 'uk-overlay-panel');
//Add an overlay panel only if image is larger than full width
$tn_id = get_post_thumbnail_id( get_the_ID() );
$img = wp_get_attachment_image_src( $tn_id, 'full' );
$width = $img[1];
if($width >= 830) {
beans_add_attribute('beans_post_header', 'class', 'uk-overlay-background');
}
else {
beans_add_attribute('beans_post_header', 'class', 'tm-light-background');
beans_add_attribute('beans_post_image', 'class', 'tm-light-background');
}
}
beans_add_smart_action('beans_post_header_prepend_markup', 'human_droid_profile_header');
function human_droid_profile_header() {
echo '<div class="tm-profile-name">';
echo '<h1>'.get_bloginfo( 'name' ).'</h1>';
echo '<h2>'.get_bloginfo( 'description' ).'</h2>';
echo '</div>';
wp_nav_menu( array( 'theme_location' => 'social-menu',
'container' => 'div',
'container_class' => 'tm-social-menu',
'menu_class' => '',
'fallback_cb' => 'false'
));
}
// Resize featured image (filter)
beans_add_smart_action( 'beans_edit_post_image_args', 'human_droid_profile_image_args' );
function human_droid_profile_image_args( $args ) {
$args['resize'] = array( 830, 430, true ); //430, 250
return $args;
}
// Load beans document
beans_load_document();