Syling Custom Fields echo’s from from functions.php

How about just echoing out the needed syntax like that: echo ‘<div class=”custom-field”>’ . genesis_get_custom_field(‘instrument’) . ‘</div>’; You can also just use CSS and style the header.entry-header { //your sexy styles goes here } Since other elements inside are wrapped in their own elements and styled separately (I mean the actual H1 and meta data) … Read more

Pull random comment from specific post, display on homepage with shortcode

The main issue with the code snippet is this line: function randomComment_handler($post_id) { Check out the Codex on add_shortcode() and see if you can find the error. Spoiler: It should be like this: function randomComment_handler( $atts, $content = NULL ) { ps: You should also avoid using extract(), use $atts[‘post_id’] instead. Further consider adding the … Read more

Conditionally write open graph meta property in header

From what I understand, you need help framing your if logic? And the php tags usage dont look right either. Does this help – <?php if(!is_single()){ if(is_home() || is_front_page()){ // not sure if you have set a static page as your front page echo ‘<meta property=”og:url” content=”‘.bloginfo(‘url’); .'” />’; }elseif(is_tag()){ echo ‘<meta property=”og:url” content=”‘.$_SERVER[“HTTP_HOST”] . … Read more

theme options not saving

Your register_setting() should be for all fields like below function register_mysettings() { //register our settings register_setting( ‘theme-settings-group’, ‘facebook’ ); register_setting( ‘theme-settings-group’, ‘twitter’ ); register_setting( ‘theme-settings-group’, ‘pinterest’ ); register_setting( ‘theme-settings-group’, ‘googleplus’ ); //etc } Do this for all fields and let me know if you stuck at anything

Add gallery id to rel attribe of wp_get_attachment_link

That filter passes more arguments than you are using. return apply_filters( ‘wp_get_attachment_link”https://wordpress.stackexchange.com/questions/134811/,”<a href=”https://wordpress.stackexchange.com/questions/134811/$url”>$link_text</a>”, $id, $size, $permalink, $icon, $text ); The second of those is the one you need. So you need to alter you callback to use the second parameter, and alter your add_filter to ask for it by setting the fourth argument to 2. … Read more