• I decided I didn’t like the accordian slider I had installed so I deleted the appropriate code from my child theme. Then I followed the instructions to put a Customizr slider in and it isn’t working. Could I have messed with any of the Customizr code? I thought it was in the parent theme, so I was safe.

    This is my site.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Theme Author presscustomizr

    (@nikeo)

    Hi @jodierd, what you did seems perfectly correct and safe since you have been working with a child theme.

    Make sure you follow the different steps to add a Customizr slider with this tutorial.

    Hope this will help!

    Thread Starter JodieRD

    (@jodierd)

    With that in mind and the tutorial (which I had been using) I checked my settings for a slider on the home page. All correct, but still didn’t show up.

    So, I chose a random page and, using the instructions in the tutorial, put a slider on it. It didn’t show up.

    What could it be other than it is looking for the code on the parent theme and isn’t finding it?

    Thanks for your help Nikeo!

    Could you post your child theme’s functions.php in pastebin (if it’s large) or here—in backticks— if it’s just a few lines?

    I’m presuming you’ve already set a front page slider in Appearance > Customize > Front Page > Slider Options.

    Thread Starter JodieRD

    (@jodierd)

    Hi ElectricFeet,

    Here’s the pastebin link (hopefully I did it right!)

    Yes, and I triple checked everything about that front page slider. That’s why I also tried putting one on another page; thinking maybe the slider code or something pointing to it is missing.

    I appreciate you taking time to help!

    Jodie

    I’m assuming below that this functions.php is correctly-placed in your child-theme’s folder.

    Your functions.php contains some old copies of Customizr code (from a very old version—a few functions don’t exist any more). So you are running your own versions of Customizr functions and dynamically overwriting the core Customizr code. This will lead to unpredictable results and is probably (but not necessarily) responsible for the problems you are having.

    You only seem to have 2 functions in your code that are your own: One function that moves the meta information to the bottom of the post and another that centres your logo. All the other seem to be duplicates of Customizr.

    Your functions.php should contain the following; nothing else:

    <?php
    
    //we hook the code on the __before_body hook, which is executed before the <body> rendering.
    // added 2014-03-26 by KLN
    add_action ('__before_body' , 'move_single_post_metas');
    
    function move_single_post_metas() {
    	//checks if we are displaying a single post. Returns false if not.
    	if ( !is_single() )
    		return;
    	//we remove the original action hooked on '__post_metas'. tc_post_metas action is a method of the TC_post_metas class
    	//We can access the instance of this class with a static property of this class that is a self instance.
    	remove_action  ( '__after_content_title' , array( TC_post_metas::$instance , 'tc_post_metas' ));
    
    	//we add the tc_post_metas action on a the __after_loop (check index.php file to see where this hook is called in the code)
    	add_action ('__after_article' , array( TC_post_metas::$instance , 'tc_post_metas'), 10);
    
    	//Additional action to display an hr separator between content and metas.
    	//We use the priority parameter to determine the rendering order of the action
    	add_action ('__after_article' , 'display_hr', 0);
    
    	//this is a nested function (function in another function), allowed with PHP.
    	function display_hr() {
    		?>
    			<hr/>
    		<?php
    	}
    }
    //end move meta function        
    
    // Center the logo from Customizr Code Snippet
    add_filter('tc_logo_text_display', 'your_logo_display');
    add_filter('tc_logo_img_display', 'your_logo_display');
    function your_logo_display($output) {
    	return preg_replace('/brand span3/', 'brand span10 offset1', $output, -1);
    }

    Replace the whole child-theme functions.php text with the above and report back.

    Thread Starter JodieRD

    (@jodierd)

    Thanks!
    I removed the old code and pasted yours in. This is what I got:

    Parse error: syntax error, unexpected '&' in /home/content/77/9269677/html/wp-content/themes/customizr-child/functions.php on line 27

    Line 27 though is a
    }
    If I counted the lines correctly.

    Am laughing about “old code” as I created this site this year.
    “Old” is relative!

    Do you have a cache to clear?

    Thread Starter JodieRD

    (@jodierd)

    Looked that up and the WordPress documentation said to look at plugins for caches that may need clearing. But now I can’t get to them. I tried putting in my old code into functions.php from pastebin but now it’s giving me the same error message. Perhaps that’s a clue?

    Could you just delete your child theme’s functions.php for now so that we have a slightly cleaner slate?

    Thread Starter JodieRD

    (@jodierd)

    Good idea.
    Done. And the site is now up again.

    Now create a new functions.php in your child theme with just <?php

    Test that it works. If it does, then add:

    //we hook the code on the __before_body hook, which is executed before the <body> rendering.
    // added 2014-03-26 by KLN
    add_action ('__before_body' , 'move_single_post_metas');
    
    function move_single_post_metas() {
    	//checks if we are displaying a single post. Returns false if not.
    	if ( !is_single() )
    		return;
    	//we remove the original action hooked on '__post_metas'. tc_post_metas action is a method of the TC_post_metas class
    	//We can access the instance of this class with a static property of this class that is a self instance.
    	remove_action  ( '__after_content_title' , array( TC_post_metas::$instance , 'tc_post_metas' ));
    
    	//we add the tc_post_metas action on a the __after_loop (check index.php file to see where this hook is called in the code)
    	add_action ('__after_article' , array( TC_post_metas::$instance , 'tc_post_metas'), 10);
    
    	//Additional action to display an hr separator between content and metas.
    	//We use the priority parameter to determine the rendering order of the action
    	add_action ('__after_article' , 'display_hr', 0);
    
    	//this is a nested function (function in another function), allowed with PHP.
    	function display_hr() {
    		?>
    			<hr/>
    		<?php
    	}
    }
    //end move meta function

    If that works, then add:

    // Center the logo from Customizr Code Snippet
    add_filter('tc_logo_text_display', 'your_logo_display');
    add_filter('tc_logo_img_display', 'your_logo_display');
    function your_logo_display($output) {
    	return preg_replace('/brand span3/', 'brand span10 offset1', $output, -1);
    }

    Once we’ve got that up and running, we can check out why your slider isn’t showing. I think it’s probably one of your plugins. You will need to deactivate them all and then reactivate one by one to see which causes the issue.

    Thread Starter JodieRD

    (@jodierd)

    I made the functions.php file in the child theme and put in
    <?php

    Go an error again. So I fiddled around and put in
    <?php
    ?>

    My page came u as it was.

    So I added the first big block of code you gave me. After the first two lines. No change. Then I took away the second line I had added. No change. Then I put that second line at the end. No change. same with putting it before the last line, //end…

    Rats!

    Is this helpful doc?

    Thread Starter JodieRD

    (@jodierd)

    Oh wait. I didn’t read to the end. So all we’re after visually is for
    a.the site to stay up and
    b. the logo to get centered.

    Added your second block and yes the logo is centered, site is up. On to disabling plugins.

    Sorry to be dense. And I’m a writer and editor. No excuse.

    Thread Starter JodieRD

    (@jodierd)

    All deactivated. Still no slider. Brought the site up on my other computer. Nope.
    Chose to add the slider on another random page. No dice.
    Since it isn’t working there’s no reason to go through the process of reactivating each one in turn I presume?

    I’m still seeing an “fbq” (facebook ?) script running…

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Missing Slider’ is closed to new replies.