Results 1 to 4 of 4

Thread: Trying to clean up and delete wordpress plugins, so..

  1. #1
    Join Date
    Jun 2011
    Posts
    212

    Default Trying to clean up and delete wordpress plugins, so..

    Getting rid or trying to get rid of ones I can do on my own via text widget or what not. I just added an adsense code and realized it was easy so why am I lazily relying on plugins. Also hoping it speeds up my site.

    I use a Testimonial and a quote widget to display what I added randomly, but I saw through googling this can be set up with a text widget. Looked like, <?php $args=array('post_type'=>'testimonials', 'orderby'=>'rand', 'posts_per_page'=>'1'); $testimonials=new WP_Query($args); while ($testimonials->have_posts()) : $testimonials->the_post(); ?> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <p><?php the_excerpt();?></p> <?php endwhile; wp_reset_postdata(); ?> so can someone explain to me how to randomize testimonials and quotes via text widget?

    Also is a most popular post text widget possible?

    Lastly (for now), I use a picasa widget for the photo widget, am looking into putting the photos on a page of there own. How would I do this, and would it be possible to have a widget that cycles through my photos via text widget?
    CLICK HERE to read blogs and see photos shaming disabled parking violators!

  2. #2
    Join Date
    Mar 2013
    Location
    United States
    Posts
    25

    Default

    You can randomize something with JavaScript in a text widget, but if you want to do it the PHP way, then you can.

    Are you inputting your own testimonials?

    You can try this:
    Code:
    <?php
    $testimonials = array('Testimonial 1', 'Testimonial 2', 'Testimonial 3');
    echo $testimonials[rand(0, (sizeof($testimonials) - 1))];
    ?>

  3. #3
    Join Date
    Jun 2011
    Posts
    212

    Default

    They are input via testimonial widget plugin. Which i think uses JS.

    When inputting testimonials how do I add them where they aren't displayed on the post page?
    CLICK HERE to read blogs and see photos shaming disabled parking violators!

  4. #4
    Join Date
    Apr 2007
    Posts
    11,468

    Default

    Quote Originally Posted by MavfanRy View Post

    Lastly (for now), I use a picasa widget for the photo widget, am looking into putting the photos on a page of there own. How would I do this, and would it be possible to have a widget that cycles through my photos via text widget?
    So you're looking for code to paste into the text widget that will rotate your photos? Is that what you mean? So you could use a javascript photo rotator that allows you to copy and paste the code into the text widget. Something like this http://www.dyn-web.com/code/rotate_images/

    I do think it's a good idea to limit the amount of plugins you use, as long as you can find a script where the code is not so bloated that it defeats the purpose.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •