Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17302
    jp_grennier
    Member

    I want to move my featured content since I’m using Slide Deck instead of the built-in slider. I was able to move to the bottom by editing functions.php, but I seem to have lost my padding. Haven’t had any luck using CSS to re-establish padding. Is there a way I can make this work?

    http://jpgrennier.com

    Thanks,
    jpg

    #17310
    Sakin
    Keymaster

    @jp_grennier: First, you shouldn’t edit any core theme files such as functions.php, style.css and so on. As all your edit will be reverted back when you update your theme to latest version. So, if you want to edit any core theme file then you have to build child theme and work on it there.

    You have changed the structure so it will be difficult the restore the css. As the divs has been moved.

    To build child theme you can just create folder in your themes directory and name it like catch-everest-child or anything as per your wish. Then first you need to create style.css file and then add the code like this https://gist.github.com/catchthemes/7483260/raw/0d66c5a1c43d188e1e548500c976b3f1bf28cfed/style.css

    And then create functions.php file where you need to add code to remove the default slider and replace it with your new slider code. Here is the sample code that you need to add in your functions.php file

    <?php
    // Removing the Default Slider
    function unhook_catcheverest_functions() {
    
    	remove_action( 'catcheverest_before_main', 'catcheverest_slider_display', 10 );
    }
    add_action( 'init', 'unhook_catcheverest_functions' );
    
    // Adding New Slider Code
    function catcheverest_child_slider() {
    	//Add in your code in betwwen this bracket
    	echo '<div id="main-slider" class="container">New Slider Code</div>';
    	
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_slider', 10 );
    #17372
    jp_grennier
    Member

    I see why the child theme makes much more sense now. I’m still having one issue though, I can’t seem to get new slider code to work with the div you specified as I don’t really know php. Right now the new slider takes up the entire main content area and is too big. Could you help with this? Thanks again Sakin.

    http://jpgrennier.com/

    #17380
    jp_grennier
    Member

    Here’s my current (child) functions.php

    <?php
    // Removing the Default Slider
    function unhook_catcheverest_functions() {
    
    	remove_action( 'catcheverest_before_main', 'catcheverest_slider_display', 10 );
    }
    add_action( 'init', 'unhook_catcheverest_functions' );
    
    // Adding New Slider Code
    function catcheverest_child_slider() {
    	//Add in your code in betwwen this bracket
    	echo do_shortcode( '[SlideDeck2 id=281 ress=1]' );
    	
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_slider', 10 );
    #17565
    Sakin
    Keymaster

    @jp_grennier: But our slider also take the entire content area. Are you talking about the height then your slider is talking the height of your image. See your image it too large http://jpgrennier.com/wp-content/uploads/2013/10/sstest1.jpg . You can just upload the cropped small image and it will be fine.

    But if you want the php wrapper. It’s not a problem. But I guess it has no use. See how to add it

    // Adding New Slider Code
    function catcheverest_child_slider() {
    echo '<div id="main-slider" class="container">';
    	//Add in your code in betwwen this bracket
    	echo do_shortcode( '[SlideDeck2 id=281 ress=1]' );
    echo '</div>';
    	
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_slider', 10 ); 
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘featured content issue’ is closed to new replies.