• Resolved AHPhoto

    (@ahphoto)


    Hi there,

    I really love this theme and would like to implement it asap. However, I am totally CSS illiterate! So go easy on me ??

    My question before even delving into this is can the home page slider in the corporate view be used as a slider only with it linking to posts?

    Thanks in advance! and for the beautiful theme.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter AHPhoto

    (@ahphoto)

    I mean “without it linking to posts”

    Hi AHPhoto,
    Thanks for appreciating our theme.
    Currently we don’t have such feature. But if you want to achieve this, you have to create child theme. If you don’t know about child theme then here is the link from codex https://codex.www.ads-software.com/Child_Themes. Its quite easy. Then go to structure->header-extenstion.php and copy this function
    cleanretina_featured_post_slider. Create functions.php in your child theme and paste the above function. Then just replace this line

    $cleanretina_featured_post_slider .= '<figure><a href="' . get_permalink() . '" title="'.the_title('','',false).'">';</a>
    with this
    $cleanretina_featured_post_slider .= '<figure><a title="'.the_title('','',false).'">';</a>
    and this line
    $cleanretina_featured_post_slider .= the_title( '<span>','</span>', false ).$excerpt.'<a href="' . get_permalink() . '" title="'.the_title('','',false).'">'.__( '... Continue Reading', 'cleanretina' ).'</a>';
    with this
    $cleanretina_featured_post_slider .= the_title( '<span>','</span>', false ).$excerpt;

    Hope this will solve your issue.
    Regards
    Team Horse

    Thread Starter AHPhoto

    (@ahphoto)

    Thank you! I will give it a try.

    These instructions are nowhere nearly enough to override any functions in this theme.

    First, the theme functions in Clean Retina aren’t written to easily override them, so you have to write a bunch more code, which I’ll show below.

    Developers, if you want people to easily override functions, please read this:
    https://codex.www.ads-software.com/Child_Themes#Using_functions.php

    Now, here is an example of how to override the default text that is output in the footer:

    // Removes cleanretina_footer_info from the cleanretina_footer phase
    function remove_thematic_actions() {
        remove_action('cleanretina_footer','cleanretina_footer_info',25);
    }
    
    // Call 'remove_thematic_actions' during WP initialization
    add_action('after_setup_theme','remove_thematic_actions');
    
    // Add our custom function to the 'cleanretina_footer' phase
    add_action('cleanretina_footer','bhw_footer_info', 25);
    
    function bhw_footer_info() {
       $output = '<div class="copyright">'.__( 'Copyright ?', 'cleanretina' ).' '.'[the-year] [site-link]'.' '.__( 'Powered by:', 'cleanretina' ).' '.'[wp-link] '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    Notice that you have to first remove the function that you want to replace, then tell when to run this code (after theme setup), then run your new function that will replace the default.

    If the developers change their functions to how WordPress prescribes, then we’ll just have to write our new function that replaces the default.

    Hope that makes sense.

    Oh, if you have more questions about this method, take a look here:
    https://www.venutip.com/content/right-way-override-theme-functions

    Hi Bill Weye,

    Thanks for your reply on this thread.
    The instructions that I have prescribed above will override that particular function and works perfectly if you are using the latest version of clean-retina

    If you look deeper into the theme, below mentioned functions are plugabble.
    cleanretina_pass_cycle_parameters
    cleanretina_comment
    cleanretina_socialnetworks
    cleanretina_home_slogan
    cleanretina_featured_post_slider
    cleanretina_breadcrumb

    Meaning that these function are coded like this in theme,

    if ( ! function_exists( 'function_name' ) ) :
     function_name() {
      //all coding goes here
     }
    endif;

    cleanretina_featured_post_slider function is also coded this way, so
    just writing the same function in the child theme’s functions.php file would easily overwrite it.
    And now, yes our theme has lots of action hook, many other functions(not the one mentioned above) are hooked to different action hooks. Now to overwrite those functions the child theme maker will have to follow the steps that you told.
    Yes this method looks tedious for a while for just one function. i.e.
    Remove the function first(your first step)
    Add the first function to after_setup_theme(second step)
    Finally add new custom function to the action hook.

    But if you have many functions to be changed then keep on adding those function inside the first function remove_thematic_actions() in your case in the remove_action function.
    Then, keep on adding your custom functions.

    Pluggable function is just a function which the child theme maker can modify, but action_hook is like the place in the theme where the child theme maker gain the power do what ever on that place(add more and more function, one after another setting the priority level, remove the parent hooked functions, alter them or anything). The main idea of our theme is to set many action hooks in every possible place and hook the functions to those hooks. So, each and every bit part will be customizable. Also most of theme frame-work make extensive use of action hooks due to this same purpose.
    I appreciate your participation in the thread. Please feel free if there is anything I can further illustrate.
    Regards,
    Team Horse

    Thread Starter AHPhoto

    (@ahphoto)

    I am finally to the point of implementing the slider. I applied your (Rabin’s) code to my child css but I do not even see the slider at all now. I am not sure how to make it work with the code change.

    Hi AHPhoto,

    It seems you are doing something wrong. The above mentioned code should be implemented in functions.php of your child theme. Please Contact us through the contact form from our website https://www.themehorse.com/ and I shall provide you the necessary file needed for creating those child theme.

    Regards,
    Team Horse

    Hello Rabin – I have a child theme and I had the same question as AHPhoto. I’m also fairly new to css, but I’ve been using my child theme (and the built in Custom CSS) to override certain features.

    I would also like to use the slider image without linking it to the blog post. However, I can’t locate the coding you pointed AHP to.

    You said “Then go to structure->header-extenstion.php and copy this function.” Where exactly is that? I looked in header.php, functions.php and a few other places . . .

    Thanks!

    Hi AnneMar279,

    Go to theme folder clean-retina->library->structure->header-extensions.php

    You will see the code in header-extensions.php

    If you have any other query please create a new thread.

    Regards,
    Team Horse

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