WordPress.org

Ready to get started?Download WordPress

Forums

WP Image Carousel
[resolved] How to add Carousel to Hompage (26 posts)

  1. Umo2net
    Member
    Posted 1 year ago #

    Please how can I add this carousel to the homepage of my blog, also to make it such that images will be added as normal post but will show in the carousel list.

    http://wordpress.org/extend/plugins/wp-image-carousel/

  2. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    So what you want to do is create a text scroller and not an image scroller. Unfortunately, WP Image Carousel only works with images.

  3. Umo2net
    Member
    Posted 1 year ago #

    Please check this link http://pmnewsnigeria.com/ and scroll down to see the image carousel used. I need something this that.

    Thank you

  4. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    You can use wpic to create the same sliding effect, but you can't have the same buttons and captions below the images. So what you want to do is create a carousel somewhere in your homepage that would fetch images automatically from your posts and then display them?

  5. Umo2net
    Member
    Posted 1 year ago #

    Can you guide me how to do this?

  6. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    Sure. I will build the code and send you a link to what should be replaced so that it would work.

  7. Umo2net
    Member
    Posted 1 year ago #

    Hey Ziv,

    I'm still expecting the code.

    Thanks

    [Please don't add reminders]

  8. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    This will take me sometime, because I have to prepare for a test. Check back tomorrow.

  9. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    The following php code will get the post thumbnails from a category you will specify. Replace AMOUNT with a number (like 5) to change the amount of images you want to show.

    Make sure your post thumbnails are all the same size.
    Place the following code block in your index.php theme file in the place that you want the image carousel to show (if you need help with this part please let me know).

    <?php
    $the_query = new WP_Query('showposts=AMOUNT&category_name=YOUR_CATEGORY_SLUG');
    $text = "";
    // The Loop
    while ( $the_query->have_posts() ) :
    	$the_query->the_post();
    	$text .= "<a href=\"".get_permalink()."\">".get_the_post_thumbnail(). "</a>\!\n";
    endwhile;
    wp_reset_postdata();
    echo do_shortcode('[wpic color="x" visible="x" width="x" height ="x"speed="x" auto="x"]'.$text.'[/wpic]');
    ?>

    Now find this following code:

    echo do_shortcode('[wpic color="x" visible="x" width="x" height ="x"speed="x" auto="x"]'.$text.'[/wpic]');

    This code resembles the shortcode settings that you update when you normally use the shortcode in the WordPress post editor. What you need to do is setup your shortcode settings and hit save.

    Let me know if this works for you or if you need more help.

  10. Umo2net
    Member
    Posted 1 year ago #

    Okay done. But how do I upload images?

  11. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    You create a post and place it in the category that you specified in the code block. Then you add a feature image to the post and save the post.

  12. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    Hi,
    I read your posting, and I really appreciate you sharing your problems and more than anything, sharing the solution. I would like to add a moving carousel to my home page. My page is commercialusedtrucks.com I would like to add it under the slider. The problem I am having is that I am using the mantra template and I dont know how to access the area where to add the code in order for the slider to show in the "home" page of the site.
    Do you have any suggestions? Thank you so much for all your help and good luck with all your tests. Elizabeth

  13. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    http://commercialused trucks.com is my website if you can check it out, please? and again I would like a moving carousel with the Feature Images from all the Posts. Again, thank you very much.

  14. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    From your WordPress dashboard, hover over the Appearance tab and click on the Editor link. From the sidebar at the right, select index.php.
    Search (using Control + F) for a piece of code that looks something like this:
    <div id="front-columns">

    Then paste the following code block above it:

    <?php
    $the_query = new WP_Query('showposts=AMOUNT');
    $text = "";
    // The Loop
    while ( $the_query->have_posts() ) :
    	$the_query->the_post();
    	$text .= "<a href=\"".get_permalink()."\">".get_the_post_thumbnail(). "</a>\!\n";
    endwhile;
    wp_reset_postdata();
    echo do_shortcode('[wpic color="x" visible="AMOUNT" width="x" height ="x"speed="x" auto="x"]'.$text.'[/wpic]');
    ?>

    Take note of where you pasted the previous code block, so that you can remove it if this fix doesn't work for you.

    Make sure you change all the x's to the correct values. Also change where is says AMOUNT (two places) to the amount of images you want to display.

    Finally click on Update File.

    If you need anymore help let me know.

  15. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    Thank you so much, it seems to be great, but now I am having another problem.
    My pictures are different sizes, some are 1280x960 others 640x480 others 485x375.
    For some reason in some posts the 640x480 fits perfectly as a featured image, and then I take a 1280x960 and bring it down to 485x375 and it does not look right under the featured image. It is like too big. Also other big pic's will fit perfectly in that features image. Why?
    The reason for this issue is the repercussion that it has in the carousel.
    The pics that fit nicely as a thumbnail in the feature image of the post they display great in the carousel.
    The pics that for some reason that I cant figure out dont fit right as a thumbnail in the feature image dont display correctly in the carousel and take a whole row, vs, that square size that I input 80x60.
    I compared the dimensions, file type etc under the media properties of two different pics, the one that fits nicely vs the one that does not and I cant figure out the difference.
    After this long explanation, any ideas???? I am running out of them and I think it is in the specs of the the images.
    Thank you

  16. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    Hi, I uploaded smaller pictures and placed them in the "featured image"
    But I do have a couple of problems.
    1- The carousel is not looping or moving, why?
    2- Some of the code is showing, why?
    3- It displays the pictures in two lines vs in one line, why?
    4- The feature images even though they dont show properly in the edit area of the posting, they do properly in the page for Categories (Light, Medium, Heavy) Why are they adjusted in that area but not in the carousel.

    Anyway, I appreciate any answers. Maybe some of them are to time consuming, so I understand if you dont, but the main questions are 1, 2 & 3. I will leave the website that way so you can see it.

    Thank you and have a happy 4th!!!

  17. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    I visited the site and I cannot see the carousel on the homepage. As for the image issue, you need to make sure your images are the same size.

  18. Pali Madra
    Member
    Posted 1 year ago #

    This issue can be closed I think as the user is not using the plugin on the page referred to by him in the post.

  19. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    Hi guys, do not close it yet, please.

    I was on vacation.... I am trying again and having the same problems, let me see what I can do, and if I fix it I will let the know the problem and the solution if I cant I will let you know.

    Thank you

  20. GlobalUsedTruckSales
    Member
    Posted 1 year ago #

    Ok, I played with your code but now it doesn't show. The arrows are there. But the feature image do not show, why?
    Thank you

  21. Ziv
    Member
    Plugin Author

    Posted 1 year ago #

    Try re-adding your shortcode to your page, use the original code I sent. Other than that, I don't really know what might be causing that issue.

  22. georgev225
    Member
    Posted 11 months ago #

    Hi i have a question I am trying to put this caurosel code into my site but it doesnt seem to work, It works perfectly when i open it with chrome but when i copy the code and paste it to my site blahhhh it doesnt work http://www.jo-va.com/footeaxle i want it to go under the distributors side

    [Too much code to post here]

  23. georgev225
    Member
    Posted 11 months ago #

    or if i can make the current distributors section slide on its on it would be perfect..

  24. WPyogi
    Volunteer Moderator
    Posted 11 months ago #

    @georgev225 - this thread is outdated and already marked resolved - please start your own here:

    http://wordpress.org/support/plugin/wp-image-carousel

    Also note that you CANNOT post lengthy code on these forums (use a pastebin) and you MUST use the code buttons for any code posted - see:

    http://codex.wordpress.org/Forum_Welcome#Posting_Code

  25. georgev225
    Member
    Posted 11 months ago #

    thank you!! sir

  26. adarshkr
    Member
    Posted 8 months ago #

    its just echoing me

    ('[wpic color="#333" visible="10" width="600px" height ="400px" speed="10" auto="1"]'.$text.'[/wpic]');

    I'm getting this line instead of pictures ...
    Whats should be the values of "X"?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic