WordPress.org

Ready to get started?Download WordPress

Forums

Meta Slider
[resolved] Slider on Homepage only (8 posts)

  1. ColletteCM
    Member
    Posted 1 year ago #

    Very easy app to customize- thank you! I would like to know how to put it into just the homepage (centered). I am new to coding and building websites fyi.... I do see what I need to copy down in the usage section on the bottom right but where do I put that to make it show up? Since it's not a page I have created I can't put it into the content section, so do I just go to appearance-editor and place it somewhere in the style.css?

    http://wordpress.org/extend/plugins/ml-slider/

  2. Matcha Labs
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Almost, you want to place the code in header.php in your theme (use the appearance editor)

    <?php
    if (is_front_page() || is_home()) {
        echo do_shortcode("[metaslider id=123]"); //replace 123 with slider ID
    }
    ?>

    Regards
    Tom.

  3. ColletteCM
    Member
    Posted 1 year ago #

    I only have access to edit style.css and not the header.php, do I need to contact my hosting and have them put that code in for me? Or can I hardcode it in style.css for the header without having to do that?

  4. Matcha Labs
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Your host is unlikely to do that for you, but could be worth a try. You can't put PHP code into the stylesheet, only styles.

    When you say you dont have access to it, what do you mean? The file just isn't listed in the appearance editor, or it is listed but you dont have access to it?

    Regards
    Tom.

  5. ColletteCM
    Member
    Posted 1 year ago #

    My host is my friend's company so I got lucky with that haha. I don't even know the difference in PHP code verse other code- I am so lost in all of this. I am definitely a visual designer and this coding is all jibberish to me and overwhelms me. The header.php is there on the side in the appearance editor but if I click on it I don't see a save option like when I am in style.css even though it seems like I can type in the box. It just says below it "You need to make this file writable before you can save your changes. See the Codex for more information." But when I click that link I don't really comprehend much of that at all....

  6. Matcha Labs
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, thanks for the info, makes sense to me.

    You'll need to ask your host to make the /wp-content/themes/your-theme/header.php file writable - they'll know what that means!

    Regards,
    Tom.

  7. ColletteCM
    Member
    Posted 1 year ago #

    Perfect, thank you so much!

  8. Guzhankov
    Member
    Posted 6 months ago #

    Hello, I want to establish a slider in this place, is shown on a site, but at me leaves that sidebar leaves down pages.

    My site: armystrong.ru

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic