Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: A MOD for Previous and Next Navigation for Single ADS Pages -- single-default.php

  1. #1
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    A MOD for Previous and Next Navigation for Single ADS Pages -- single-default.php

    My MOD for Previous and Next Navigation for Single ADS Pages -- single-default.php

    I came in here weeks ago forthrightly and courageously demanding some New Features !
    (whimpering and begging, to tell the truth . .. )

    So, I decided to go make something for myself that did pretty much the same thing that I thought would be useful for Users of Classipress, that is, End Users.

    I wanted something similar to the Breadcrumbs, and similar to the Main Category listings that are paginated after the Ad Category listings reach their page display limit, such as 5 or 10, whatever, and show you the little "Page 1 of 3 " 1 | 2 | 3 |

    What I wanted was this:

    The user is in a certain Ad category, such as, "Hitmen for Hire".

    They see a vertical list of returned Vets ready for some mercenary action with their newly acquired technical skills.

    The user selects an Ad entitled "Have AK-47, Will Travel"--

    Up pops our Ad with all the gory particulars.

    Underneath the Breadcrumb:

    Home » Assassins & Mercenaries » Affordable Contractors » Have AK-47, Will Travel

    I wanted something like this

    « See an Older Ad in this category << 21 Ads in this Category >> See a Newer Ad in this category »

    Click on the "Older Ad" or click on the "Newer Ad" and the NEXT AD IN THIS SAME CATEGORY DISPLAYS withOUT NEEDING to RETURN to the Starting page of the Category Ads.

    This little NAVIGATION AID keeps track of the Next Ad and the Next Ad every time the Single Ad display page loads.

    INSTEAD OF GOING BACK TO THE MAIN CATEGORY LIST OVER AND OVER TO PICK ANOTHER AD !!

    So, that is what I made using regular pre-existing WordPress functions...it's simple and You are welcome to use this code--


    So here is the MOD to make looking at individual ads in a category FASTER...

    It can be modded further to respond to different needs and characteristics.

    But here is a version that works well for me.

    Open up the Single-default.php file in any version of Classipress from 3 on... 01..02..03..04

    In the virgin file, in 3.0.4, for instance you will find these lines:

    PHP Code:
     line 19:    <div id="breadcrumb">
          <?php if(function_exists('cp_breadcrumb')) cp_breadcrumb(); ?>
            </div>


    line 25:       <div class="content_left">
    So, here is the code to replace that--

    PHP Code:
                 <div id="breadcrumb">
                      <?php if(function_exists('cp_breadcrumb')) cp_breadcrumb(); ?>
                  </div>
                  <?php
    $category 
    get_the_category();
    ?>         
                  <div id= "mynavlinks">&nbsp;&nbsp;<?php previous_post_link('%link''&laquo;&nbsp;See an Older Ad in this category'TRUE'3');  ?>&nbsp;&nbsp;<?php echo '<< ' .$category[0]->category_count ' Ads in this Category >>'?>&nbsp;&nbsp;<?php next_post_link('%link''See a Newer Ad in this category&nbsp;&raquo;'TRUE'3');?></div>

                    <div class="content_left">
    Save it and upload it and see what you get.

    Go to any Ad category...such as the archive listing of all posts/ads in one of your categories that has the MOST listings.

    Drill in to the middle of the pack and select one ad to look at, click on it, look at it now as a single Ad, all by its lonesome.

    IF you are using the Breadcrumb in your navigation then you should see some new lines indicating how many ADs are in THIS category.

    If you are in a Parent Category, it will list all ads in that Parent category.
    If you are in a Sub-category it will list all Ads in that Sub-category.

    This mod is set up to simply accept the default...which is that the date an ad is posted determines where it shows up in the whole forward and back.

    I gave this a Div ID so that you can write specific CSS code to apply to just this Navigation Aid.

    That's it. Nothing will blow up if you want to drop this code in to your single-default.php page. Save the original single-default.php and be ready to upload it if you decide not to use this mod code.

  2. #2
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    MODIFIED; UPGRADED Category Navigation MOD code

    You must be an AppThemes customer and logged in to view this response. Join today!

  4. The Following 2 Users Say Thank You to vienna For This Useful Post:

    bestusads (November 10th, 2010), espider (August 27th, 2010)

  5. #4
    Veteran spymare's Avatar
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    871
    Thanks
    16
    Thanked 82 Times in 61 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    Here's what it LOOKS LIKE....

    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #6
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    maybe this image is clearer

    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #7
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    maybe NOW ??

    You must be an AppThemes customer and logged in to view this response. Join today!

  9. The Following User Says Thank You to vienna For This Useful Post:

    espider (August 27th, 2010)

  10. #8
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,982
    Thanks
    170
    Thanked 3,408 Times in 3,279 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  11. #9
    ajwilson's Avatar
    Join Date
    Aug 2010
    Location
    Australia
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    pjlawrence's Avatar
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Single Post Ad
    By CCRussell in forum ClassiPress General Discussion
    Replies: 2
    Last Post: December 16th, 2016, 07:25 AM
  2. Add Featured Slider To Single Ad Pages - Quick Tutorial
    By netpotion in forum ClassiPress General Discussion
    Replies: 143
    Last Post: February 21st, 2016, 12:50 PM
  3. Different single-default.php for different categories?
    By mark1975 in forum ClassiPress General Discussion
    Replies: 2
    Last Post: August 20th, 2014, 01:07 PM
  4. Removing Contact/Poster box on single ad pages
    By rosetrees in forum Help Using ClassiPress
    Replies: 8
    Last Post: August 4th, 2014, 05:46 AM