SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2011
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add a bigger number of posts after a specific number of posts

    I am using the wordpress theme wptube premium and my site is imediazone.net. I would like to do the following: As you can see on my site 12 posts(video thumbs), what i want is after the 9 th post, when i add more posts to end the sidebar and let me add more posts ( another 2 would fit) after that.
    My main index template is:
    PHP Code:
    <?php

    get_header
    ();

    $orderby 'date_new';
    $orderby '&orderby=date';
    if(isset(
    $_GET['order']) && !empty($_GET['order']))
    {
        
    $order $_GET['order'];
        switch(
    $order)
        { 
            case 
    'date_old' :    $orderby '&orderby=date&order=ASC';
                break;
            case 
    'rated' :    $orderby '&r_sortby=highest_rated&r_orderby=desc';
                break;
            case 
    'viewed' :    $orderby '&v_sortby=views&v_orderby=desc';
                break;
            case 
    'discussed' :    $orderby '&orderby=comment_count';
                    function 
    comment_count_orderby$orderby ) {
                        return 
    "comment_count DESC";
                    }
                    
    add_filter('posts_orderby''comment_count_orderby');
                break;
            default :     
    $orderby '&orderby=date';
                break;
        }
    }
    $order_url get_option('home').'/?order=';
    ?>

    <div id="wrapper" alt="free music videos">
      <div id="mainbody" alt="free music videos">
        <?php if(is_home() && !is_paged()) { ?>
        <div id="myslides"> <img src="<?php bloginfo('template_directory');?>/images/cornerimage.png" class="cornerimage" alt="cornerimage"/>
          <?php include (TEMPLATEPATH "/includes/slide.php"); ?>
        </div>
        <?php ?>
        <div id="content" alt="free music videos">
          <div class="sortby_container" alt="free music videos">
            <div class="sortby_body" alt="free music videos">
              <div class="fl" alt="free music videos">
                <?php if($order=='rated') : ?>
                <?php _e('| Sorted by Highest Rated''wpt'?>
                <?php endif; ?>
                <?php if($order=='discussed') : ?>
                <?php _e('| Sorted by Most Discussed''wpt'?>
                <?php endif; ?>
                <?php if($order=='viewed') : ?>
                <?php _e('| Sorted by Most Viewed''wpt'?>
                <?php endif; ?>
                <?php if($order=='date_new') : ?>
                <?php _e('| Sorted by Newest First''wpt'?>
                <?php endif; ?>
                <?php if($order=='date_old') : ?>
                <?php _e('| Sorted by Oldest First''wpt'?>
                <?php endif; ?>
              </div>
              <div id="sortbybox" class="fr" alt="free music videos">
                <ul class="menu" alt="free music videos">
                  <li><a href="#" onclick="javascript:showlayer('sm_1')">
                    <?php _e('Sort by''wpt'?>
                    </a>
                    <ul class="submenu" id="sm_1">
                      <li><a href="<?php echo $order_url?>rated">
                        <?php _e('Highest Rated''wpt'?>
                        </a></li>
                      <li><a href="<?php echo $order_url?>discussed">
                        <?php _e('Most Discussed''wpt'?>
                        </a></li>
                      <li><a href="<?php echo $order_url?>viewed">
                        <?php _e('Most Viewed''wpt'?>
                        </a></li>
                      <li><a href="<?php echo $order_url?>date_new">
                        <?php _e('Newest First''wpt'?>
                        </a></li>
                      <li><a href="<?php echo $order_url?>date_old">
                        <?php _e('Oldest First''wpt'?>
                        </a></li>
                    </ul>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <div class="clearboth" alt="free music videos"></div>
          <?php query_posts($query_string.$orderby); if (have_posts()) : ?>
          <?php while (have_posts()) : the_post(); ?>
          <?php if ( in_category(get_option('wptube_non_vid_category'))) : ?>
          <ul class="display thumb_view">
            <li>
              <div class="window" alt="free music videos">
                <div class="postb_bottom" alt="free music videos">
                  <div class="posti_inside" alt="free music videos">
                    <div class="paneleft_nonvideo"> <?php print_video_thumb($post?> </div>
                    <div class="paneright" alt="free music videos">
                      <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute('echo=1'); ?>">
                        <?php the_title(); ?>
                        </a></h4>
                      <div class="entry">
                        <?php the_excerpt(''); ?>
                      </div>
                      <div class="continue"><a href="<?php the_permalink(); ?>">
                        <?php _e('Continue &raquo;''wpt'); ?>
                        </a></div>
                    </div>
                  </div>
                  <div class="postfeedback">
                    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
                    |
                    <?php comments_popup_link(__('No Comments''wpt'), __('1 Comment''wpt'), __('% Comments''wpt')); ?>
                    |
                    <?php if(function_exists('the_views')) { the_views(); } ?>
                    |
                    <?php the_time('j F Y'?>
                  </div>
                </div>
                <div style="clear:both;"></div>
              </div>
              <div class="videopart" alt="free music videos">
                <div class="paneleft_nonvideo"> <?php print_video_thumb($post?> </div>
                <div class="vid_title"> <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
                  <?php $tit the_title('','',FALSE); echo substr($tit040); if (strlen($tit) > 40) echo " &raquo;"?>
                  </a><br />
                </div>
                <div class="date_views" alt="free music videos">
                  <?php if(function_exists('the_views')) { the_views(); } ?>
                  |
                  <?php the_time('j M y'?>
                </div>
                <div style="clear:both;"></div>
              </div>
            </li>
          </ul>
          <?php else : ?>
          <ul class="display thumb_view">
            <li>
              <div class="window" alt="free music videos">
                <div class="postb_bottom" alt="free music videos">
                  <div class="posti_inside" alt="free music videos">
                    <div class="paneleft"> <?php print_video_thumb($post?> </div>
                    <div class="paneright" alt="free music videos">
                      <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute('echo=1'); ?>">
                        <?php the_title(); ?>
                        </a></h4>
                      <div class="entry">
                        <?php the_excerpt(''); ?>
                      </div>
                      <div class="continue" alt="free music videos"><a href="<?php the_permalink(); ?>">
                        <?php _e('Continue &raquo;''wpt'); ?>
                        </a></div>
                    </div>
                  </div>
                  <div class="postfeedback" alt="free music videos">
                    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
                    |
                    <?php comments_popup_link(__('No Comments''wpt'), __('1 Comment''wpt'), __('% Comments''wpt')); ?>
                    |
                    <?php if(function_exists('the_views')) { the_views(); } ?>
                    |
                    <?php the_time('j F Y'?>
                  </div>
                </div>
                <div style="clear:both;" alt="free music videos"></div>
              </div>
              <div class="videopart" alt="free music videos">
                <div class="paneleft" alt="free music videos"> <?php print_video_thumb($post?> </div>
                <div class="vid_title" alt="free music videos"> 
                  <?php $tit the_title('','',FALSE); echo substr($tit040); if (strlen($tit) > 40) echo " &raquo;"?>
                  <br />
                </div>
                <div class="date_views" alt="free music videos">
                  <?php if(function_exists('the_views')) { the_views(); } ?>
                  |
                  <?php echo time_ago(); ?>
                </div>
                <div style="clear:both;"></div>
              </div>
            </li>
          </ul>
          <?php endif; ?>
          <?php endwhile; ?>
          <h1></h1>
          <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
        </div>
        <?php get_sidebar(); ?>
        <?php else : ?>
        <h3>
          <?php _e('Your search''wpt'); ?>
          <strong>&quot;<?php echo get_search_query(); ?>&quot;</strong>
          <?php _e('did not match any documents.''wpt'); ?>
        </h3>
        <br/>
        <h4>
          <?php _e('Suggestions:''wpt'); ?>
        </h4>
        <ul class="searchresindex">
          <li>
            <?php _e('Make sure all words are spelled correctly.''wpt'); ?>
          </li>
          <li>
            <?php _e('Try different keywords.''wpt'); ?>
          </li>
          <li>
            <?php _e('Try more general keywords.''wpt'); ?>
          </li>
        </ul>
      </div>
      <?php get_sidebar(); ?>
      <?php endif; ?>
    </div>
    <?php get_footer(); ?>
    AND my style.css is: http://www.imediazone.net/multimedia...tube/style.css.

    Here is a screen shoot of what i want to do:

    ScreenShot183.jpg

    Don't know where to get started i am a noob in php. And i know some css, but i declare myself still a noob.
    Please do help me i will add reputation point.

  2. #2
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I didn't look at the code you posted, I am assuming if you tell WP to display 13+ thumbnails, they wrap to after the third column. If so, the div you have your side bar in is not inside the div that your videos are in. If you put a border on these, you will see this..
    Ryan B | My Blog | Twitter

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2011
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rguy84 View Post
    I didn't look at the code you posted, I am assuming if you tell WP to display 13+ thumbnails, they wrap to after the third column. If so, the div you have your side bar in is not inside the div that your videos are in. If you put a border on these, you will see this..
    Thanks for the reply, i understand what you mean, but how to put a border? I mean the code is a bit complicated, don't know exactly what to do.

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2011
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually i changed my mind i want to add a module below those: Something like "Most viewed", just that don't know where to start.
    Single thing i know is to add the header with the name "MOst viewed", that i just added, don't know how to add the content, wished to make the top 5 most viewed videos, all in a line.

  5. #5
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    How much of the code did you write, copy from elsewhere, and came from a source/theme you downloaded?
    Ryan B | My Blog | Twitter

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2011
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rguy84 View Post
    How much of the code did you write, copy from elsewhere, and came from a source/theme you downloaded?
    The theme is called wptube, it is a premium, i did not create it, i just want to modify it. Just that don't know where to start. I only added the title on my index page for the module i want to add: "Most Viewed".

  7. #7
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imediazone View Post
    The theme is called wptube, it is a premium, i did not create it, i just want to modify it. Just that don't know where to start. I only added the title on my index page for the module i want to add: "Most Viewed".
    Oh I see. To be honest that code is junk, and looks like it was thrown together. The code
    Code html4strict:
     <div class="continue" alt="free music videos">
    isn't even valid code! It looks like the author is trying to "help" you and do SEO, but that wouldn't do any good for you.
    1. If you are using firefox, I would get firebug, and look at the code with that. Usually by default you can click on the page and it traces through code to where you clicked. If you use IE8+, you can hit f12, then ctrl+B within the devloper tools panel, and click like in firefox. If you use chrome, you can hit F11 or f12, which opens a firebug-like panel.
    2. Once you click, click the element in the next level of the heirarchy to ensure you are getting the whole part of that section, and take note of the class/id name.
    3. Go into you css, find the noted class/id, add a border to it, to make sure thats it.
    4. Put the section within the div with the videos
    5. Check flow and such
    6. Remove the border for the section, then
    Ryan B | My Blog | Twitter


Bookmarks

Posting Permissions

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