• Resolved peterhjalmarsson

    (@peterhjalmarsson)


    I’m getting the nasty feeling that my functions.php is not executing. Is there any way I can check that for sure? (I’ve tried adding funtions that I think should do certain things, and they don’t, but there might be errors in the function of course.)

    And of course: if it does not execute: what can I do to fix it.

    style.css works fine btw. Site: https://peterhjalmarsson.hopto.org/donostia.se/

Viewing 4 replies - 1 through 4 (of 4 total)
  • stellamaris5

    (@stellamaris5)

    What’s your version of PHP?

    rdellconsulting

    (@rdellconsulting)

    See this

    Thread Starter peterhjalmarsson

    (@peterhjalmarsson)

    5.5.12

    I would very much like a tip on how to check if the code is executed at all. Something like putting a “debug.print ‘hi'” and looking at the console to see if it’s printed. ??

    Here’s my php btw. None of the functions in there seems to work.

    <?php
    /**
    * This is where you can copy and paste your functions !
    */
    
    function my_new_contactmethods( $contactmethods ) {
    // Add Twitter
    $contactmethods['twitter'] = 'Twitter';
    //add Facebook
    $contactmethods['facebook'] = 'Facebook';
    
    return $contactmethods;
    }
    add_filter('user_contactmethods','my_new_contactmethods',10,1);
    
    /**************************************************/
    /* ?ndra i "hover"-texterna f?r sociala l?nkar    */
    /**************************************************/
    add_filter('tc_default_socials' , 'change_link_title');
    function change_link_title($socials) {
        foreach ($socials as $key => $value) {
            $socials[$key]['link_title'] = str_replace('Follow me', 'Folj oss', $socials[$key]['link_title']);
            $socials[$key]['link_title'] = str_replace('Subscribe to my rss feed', 'Prenumerera p? v?rt RSS-fl?de', $socials[$key]['link_title']);
        }
        return $socials;
    }
    /**************************************************/
    
    // START OF Center Header Block Items (Needs additional CSS code in Child Theme style.css)
    // NAVBAR WRAPPER //
    /* Beh?vs inte f?r Customizr 3.2 */
    // LOGO //
    // center the logo //
    /* Beh?vs inte f?r Customizr 3.2 */
    // TAGLINE //
    // center the Tagline
    add_filter('tc_tagline_class', 'rdc_tagline_class');
    function rdc_tagline_class() {
         return 'span12';
    }
    // SOCIAL ICONS //
    // center the output of tc_social_in_header:
    add_filter('tc_social_header_block_class', 'rdc_social_header_block_class');
    function rdc_social_header_block_class($social_header_block_class) {
         if ('span5' == $social_header_block_class) {
             $social_header_block_class = 'span12';
         }
         return $social_header_block_class;
    }
    // END OF Center Header Block Items (Needs additional CSS code in Child Theme style.css)
    
    /* ?ndra "credits"-texten i footern. */
    add_filter('tc_credits_display', 'my_custom_credits');
    function my_custom_credits(){
    $credits = 'Site av Interes AB. Baserad p? temat Customizr av Themes & Co';
    $newline_credits = '';
    return '
    <div class="span4 credits">
        		    	<p> · ? '.esc_attr( date( 'Y' ) ).' <a href="'.esc_url( home_url() ).'" title="'.esc_attr(get_bloginfo()).'" rel="bookmark">'.esc_attr(get_bloginfo()).'</a> · '.($credits ? $credits : 'Designed by <a href="https://www.themesandco.com/">Themes & Co</a>').' ·'.($newline_credits ? '<br />· '.$newline_credits.' ·' : '').'</p>		</div>';
    }

    Thread Starter peterhjalmarsson

    (@peterhjalmarsson)

    Fixed it. Functions.php was in a sub-directory to the child directory.
    (Walks away in shame…)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘functions.php not executing?’ is closed to new replies.