How Do I Add in 'Views' here?

Discussion in 'ClassiCraft WordPress Theme' started by calvinhon, Aug 14, 2013.

Thread Status:
Not open for further replies.
  1. calvinhon

    calvinhon Member

    Joined:
    Apr 1, 2013
    Messages:
    105
    Likes Received:
    3
    Hi Support,

    I would like to add in 'Views' on top of the 'Price' and 'View It' - see attachment.
    How do I go about doing so?

    Thanks,
     

    Attached Files:

  2. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to index.php present in your theme directory and add the code given below

    Code:
    <span class="views"><?php echo cc_getPostViews(get_the_ID()); ?></span>
    Sending image for reference

    2013-08-14_1233.png



    Use same process for others also.


    Now,
    Paste this code in Custom CSS
    Settings > Theme Options > Styling Options > Custom CSS
    Code:
    .featured_item .views{
    padding-left: 10px;
    display: inline-block;
    color: #17569b;
    }
    
     
  3. calvinhon

    calvinhon Member

    Joined:
    Apr 1, 2013
    Messages:
    105
    Likes Received:
    3
    Hey! Thanks Gourav! Sorry to trouble you again, i realise i should put UNDER the 'View It' tab....where do I insert the code you provided earlier on?
    thanks,
     
  4. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to index.php and add code given below

    Code:
    <li><span class="views"><?php echo cc_getPostViews(get_the_ID()); ?></span></li>
    Sending image for reference

    2013-08-16_1208.png
     
  5. calvinhon

    calvinhon Member

    Joined:
    Apr 1, 2013
    Messages:
    105
    Likes Received:
    3
    Man! Gourav you ARE the man! It works perfectly! I love it!
    Thanks...

    BUT, i have a small problem after inserting that new code, in the GRID VIEW the picture and stuff RUNS....oh bugger! so, is there a code to re-align it?

    THanks,, - see attached picture for reference
     

    Attached Files:

  6. dailypaymentjobs

    dailypaymentjobs New Member

    Joined:
    May 15, 2013
    Messages:
    19
    Likes Received:
    0
    Yes.. I have the same problem in Grid View. Please rectify it.
     

    Attached Files:

  7. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Just go to the same page i.e. index.php and same line number 207.
    Remove the li tag (<li>, </li>) and add </br> tag as shown in the image given below.

    [​IMG]

    This will solve your issue.
     
  8. dailypaymentjobs

    dailypaymentjobs New Member

    Joined:
    May 15, 2013
    Messages:
    19
    Likes Received:
    0
    Yes done. Now its work fine. Thank you Piyush.
     
  9. calvinhon

    calvinhon Member

    Joined:
    Apr 1, 2013
    Messages:
    105
    Likes Received:
    3
    nope, i did it, it still runs, sorry Piyush.
    And where else do I need to paste the previous code (Views) for the 'All Ad' page as well - cause I've paste to the part where I should be doing in the index.php? See Attach to see what i mean by 'All Ad' page..
     

    Attached Files:

  10. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to template_all_ads.php present in your theme directory and add the code given below

    Code:
    <span class="views"><?php echo cc_getPostViews(get_the_ID()); ?></span>
    Sending image for reference

    2013-08-19_1154.png


    This will solve your issue.
     
    amaconline likes this.
  11. calvinhon

    calvinhon Member

    Joined:
    Apr 1, 2013
    Messages:
    105
    Likes Received:
    3
    Cool! I kinda slightly amended your code to this: <li><span class="views"><?php echo cc_getPostViews(get_the_ID()); ?></span></li> so that it appears beneath 'View It' button.

    Thanks Gourav!
     
Thread Status:
Not open for further replies.

Share This Page