• I was looking at https://www.lucky-33.com and I’m wondering how he set his main news column to pull the news & then incorperate that nifty little drop down button w/ comments, author, time posted, etc…..any ideas? Obviously I’ve tried contacting the owner but to no avail; its been awhile since he’s updated that site, so maybe he’s awol? Thanks in advance for any ideas/comments/suggestions….
    -Ian

Viewing 15 replies - 1 through 15 (of 15 total)
  • Just some javascripting. He put the info in a div and gave it a DHTML sliding effect onClick.

    Thread Starter idowens

    (@idowens)

    I understand the ‘concept’, could you give me some pointers as far as implementation goes? And Thanks!

    Thread Starter idowens

    (@idowens)

    What I don’t understand is how to make the script call for the needed information from wordpress…in otherwords, if I setup a similar JS table for the ‘look’ (which is the easy part) how do I then tell WP to call for and insert than information?

    I can relate to what seems like a kind of awe at viewing the index.php and other source files in WP.
    For a long time i posted questions like these and felt kinda weird about the replies i got.
    essentially doing this is easier than you may imagine.
    here’s a basic step by step overview:
    1. get (or write) the code for the feature you want.
    2. add it to your index.php
    be it a js call, or a php tag, whatever… just stick it where you want it.
    3. now style it. give it a class of its own, and go nuts.
    this really should be all you need.
    a great example of javascripting in WP is in the show/hide comments hack/plug from scriptygoddess.
    very well documented, and adds a link to the loop, calling js and popping open the comments include.
    a close look at this, and some time well spent and i’ll bet you’ll get a fantastic result.
    don’t forget to come back and show us what you got!
    f.

    Do you mean generating the HTML? I’ll take a small excerpt from my index.php:
    <h1><?php the_title(); ?></h1>
    <cite>Published <?php $entry_datetime = abs(strtotime($post->post_date)); echo time_since($entry_datetime) ?> ago by <?php the_author() ?></cite>
    <?php the_excerpt(); ?>
    " class="more">read more
    <p class="details"><span class="commentlink"><?php comments_popup_link(__('no comments yet'), __('1 comment'), __('% comments')); ?></span> | posted to <?php the_category(' | ') ?>

    Notice how it’s set up differently from the default install? All of those <?php tags are in essense the stuff that WordPress is spitting out. So I could do something like this:
    Expand Details
    <div class="expand">
    Author: <?php the_author() ?>

    Category: <?php the_category() ?>

    </div>
    After some CSS styling and writing my doSomething() function in javascript, I would have the same effect that he’s had. Just use the template tags in WordPress to manufacture your HTML.
    I hope that helps a bit…

    sorry, Ian, I assure you I’m not AWOL, been busy lately…to address your question about the dropdowns, Brak was correct…Basically, i just use the general wordpress functions to output the information i want into a div, something like this:
    <ul class="meta" id="postMeta-<?php the_ID(); ?>">
    <li class="first">Written by:&nbsp;<?php the_author(); ?> @ <?php the_time(); ?> on <?php the_time('M j, Y'); ?>

    • Filed under:&nbsp;<?php the_category(', '); ?>
    • Viewed:&nbsp;<?php get_post_views($post->ID, is_single()); ?> times
    • Comments:&nbsp;#comments" title="Comments for <?php the_title(); ?>"><?php comments_number(); ?>
    • <?php
      if (is_single()) {
      ?>

    • Previous Post:&nbsp;<?php previous_post("%", "", "yes", "no", 1, ""); ?>
    • Next Post:&nbsp;<?php next_post("%", "", "yes", "no", 1, ""); ?>
    • <?php
      }
      ?>
      <?php edit_post_link("Edit This", "

    • Edit:&nbsp;", "
    • "); ?>

      then i use some CSS/Javascript to manipulate the CSS display property on that DIV…simple, see? any more questions, let me know…i’ll try to be a bit more prompt ??

    and by DIV i obviously meant UL…sorry, i should read things a bit better before i write them

    Thread Starter idowens

    (@idowens)

    Dss, brak, and Lucky, thanks so much for your responses…I’m going to play with it a bit and see what I can come up with. One thing I’ve enjoyed about WP is being able to roll up my sleeves & learn new things (as opposed to choosing a template from 20 or so radio-button choices and it looking…institutional.
    The support I’ve received on the forums is greatly appreciated. Thanks again!

    Thread Starter idowens

    (@idowens)

    Lucky, in the first line of what you posted, I don’t seem to have anything that coincides w/ <?php the_ID(); ?> . Could you explain this part?

    Thread Starter idowens

    (@idowens)

    I’m getting something like this where I have my code inserted: Fatal error: Call to undefined function: the_author() in /home/idowensc/public_html/two/index.php on line 232. I’m not sure how to interpret this (other than, it can’t seem to find what its looking for)
    The current test folder i’m working out of is NOT the same folder I have WP installed into on my server. Do I need to define the loc of the WP folder somewhere in the my php?
    Again, thanks for all your help guys.

    well, that function, the_ID(), must be within “the loop”, as it is known around here…i kinda left that code out, but wherever you see something like foreach ($posts as $post), that is generally the loop where the posts are getting written out…

    “Javascript to manipulate…” I’m such a noob at this, I don’t know anything about java-scripts =/
    I would be so happy if you could post the script somewhere so that I can have a look at it.

    can someone help me with that java thing? I’ve never used java scripts before….

    anon – i’ll post up a js file i’m using to expand/contract my comments once i get home.

    thnx!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘how’d he do that?’ is closed to new replies.