This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

edit framework function in styles.css

  • Creator
    Topic
  • #3126
    vtheme
    Participant

    Hi, I think I am close but am missing something. I wanted to add another social media button (a cart png actually) in the framework file display.php for the function:

    function themeblvd_social_media_option( $id, $name, $val ) {
    $sources = array(
    ‘amazon’ => ‘Amazon’,
    ‘delicious’ => ‘del.icio.us’,
    ETC..
    ‘cart’ => ‘Cart’
    )
    ETC
    }

    I have been able to do this successfully by editing the framework file, but want this in the child theme so that it stays. Per the docs (and they are great learning tools BTW!) it seemed that I should place this in the styles.css just prior to:

    /*——————————————————-*/
    /* Run Theme Blvd framework (required)
    /*——————————————————-*/

    require_once ( TEMPLATEPATH . ‘/framework/themeblvd.php’ );

    /*——————————————————-*/
    /* Start Child Theme
    /*——————————————————-*/

    ETC.

    This is not working though, and I wondered if i have this in the wrong place, or that I need to add an action to get this to take.

    Any help – greatly appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #3151
    Jason Bobich
    Keymaster

    Hello,

    To copy this PHP function to your Child theme to edit it, you need to copy it to functions.php of your Child theme before the framework runs. You wouldn’t be doing this in style.css. Does that make sense?

    #3156
    vtheme
    Participant

    Yes, but from the docs at : http://dev.themeblvd.com/tutorial/editing-framework-functions/ (at the bottom) it appeared for this function (display.php) I needed to place as I did. The one other thing that concerned me, was that in display.php, there was no if( ! function_exists( ‘whatever_function’ ) conditional,, so I figured I’d end up having a problem when the same function was declared twice.

    I will try this and see.

    #3160
    Jason Bobich
    Keymaster

    Sorry, I was confused because you were saying “style.css” where I think you meant to say “functions.php” — Ok, so I’m looking closer at the function you’re trying to edit and the answer is no, you cannot edit it from your Child theme by copying it. The reason I do not have this setup to be copied is because I can’t think of a scenario to why you’d be doing that. The reason I say that is because it has a filter on the array of social icons, and so that’s how one would modify that.

    http://dev.themeblvd.com/tutorial/filters/

    function my_social_media_buttons( $sources ){
    	$sources['new_icon'] = 'New Icon';
    	return $sources;
    }
    add_filter( 'themeblvd_social_media_buttons', 'my_social_media_buttons' );
    #3167
    vtheme
    Participant

    Putting this in functions.php even at tthe top is getting me redeclaration errors. Is there anything I am doing wrong?

    whoops. didnt see your latest post

    • This reply was modified 10 years, 4 months ago by vtheme.
    • This reply was modified 10 years, 4 months ago by Jason Bobich.
    #3171
    vtheme
    Participant

    getting there…, but instead of my cart button showing that I added in a custom png for the social icons that is at the end.. at position -744.. I am getting position 0= amazon….so I need to do some readjusting now. Is there a quick way to edit that? I already had it working with the display.php edit.

    I had accommodated for that in custom.css as;
    .themeblvd-contact-bar li .cart { background-position:0 -744px; }

    WHOOPS – I got it — sorry for the trouble!

    Thanks again for such stellar support!

    • This reply was modified 10 years, 4 months ago by vtheme.
    • This reply was modified 10 years, 4 months ago by vtheme.
    • This reply was modified 10 years, 4 months ago by Jason Bobich.
    #3174
    vtheme
    Participant

    You made this way easier! Wish I has seen that filter earlier!!

    • This reply was modified 10 years, 4 months ago by vtheme.
    • This reply was modified 10 years, 4 months ago by Jason Bobich.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.