Whats wrong in this blog post-header code

Discussion in 'PHP' started by Goltu, Jan 9, 2009.

  1. #1
    Hi

    I have a blog here.

    I have a strange thing suddenly in the post header part. In each of the posts, the first category link in the "Filed Under .........." got messed. Instead of category link it is displaying the Post URL with a "<a" at the last which ultimately leads to a 404 page.

    I am not a programmer and cant do much in it to fix this. Can anyone look around this code please and tell me what needs to be changed.

    Here is the code of postheader.php file-
      <div class="entry">
    <!– google_ad_section_start –>
          
    <div class="postheader">
    <?php if (function_exists('slds_date_stamp')) { slds_date_stamp(get_the_time('U'), $k2_post_alt); } ?>
     <h1 class="entrytitle" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?> »</h1></a> Filed Under <a 
    
    rel="nofollow" href=<?php the_permalink(); ?><?php the_category(','); ?> </a> 
    <div class="entrymeta"> 
     </div>
        </div>
          
    <!– google_ad_section_end –>
    Code (markup):
    Please tell me if any other file's code is needed to fix it. Thanks for your help.
     
    Goltu, Jan 9, 2009 IP
  2. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    i think you missed a semi-colon on 6th line. please replace your code with this:


      <div class="entry">
    <!– google_ad_section_start –>
          
    <div class="postheader">
    <?php if (function_exists('slds_date_stamp')) { slds_date_stamp(get_the_time('U'), $k2_post_alt); } ?>
     <h1 class="entrytitle" id="post-<?php the_ID(); ?>"> <a href="[COLOR="Red"]<?php the_permalink(); ?>[/COLOR]" rel="bookmark"><?php the_title(); ?> »</h1></a> Filed Under <a 
    
    rel="nofollow" href=<?php the_permalink(); ?><?php the_category(','); ?> </a> 
    <div class="entrymeta"> 
     </div>
        </div>
          
    <!– google_ad_section_end –>
    
    Code (markup):
    hope this solves the issue.

    you missed semi-colon in code highlighted above.
     
    khan11, Jan 9, 2009 IP
  3. Goltu

    Goltu Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey I pasted this code and nothing changed at the blog.

    Looks like it is the exact same code as I gave above. I can not notice any extra ";" in the 6th line in your code. Can you check it again please.
     
    Goltu, Jan 9, 2009 IP
  4. dmcybox

    dmcybox Banned

    Messages:
    225
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think this one is messed up:

    Filed Under <a
    rel="nofollow" href=<?php the_permalink(); ?><?php the_category(','); ?> </a>
    <div class="entrymeta">

    change it to this:

    <a rel="nofollow" href="<?php the_permalink(); ?><?php the_category(','); ?>">Filed Under</a>
    <div class="entrymeta">


    And post some update to your blog..
     
    dmcybox, Jan 9, 2009 IP
  5. Goltu

    Goltu Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nope, this too didnt worked, thx for the help though.
     
    Goltu, Jan 9, 2009 IP
  6. FreddyBiatso

    FreddyBiatso Peon

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ?php the_permalink()

    Have you checked this function to see If It has any mistake?
     
    FreddyBiatso, Jan 9, 2009 IP
  7. Goltu

    Goltu Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    As I said I am not a programmer, I have no clue where and how to check that. There is a file pagefunctions.php there but this code is not there.:confused:
     
    Goltu, Jan 9, 2009 IP
  8. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #8
     Filed Under <a rel="nofollow" href="<?php the_permalink(); the_category(','); ?>"><?php the_category(','); ?></a>
    Code (markup):
    Hard to know without you telling us what it outputs.
     
    Danltn, Jan 9, 2009 IP
  9. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #9
    @ Goltu

    actually dear, i pointed out the same mistake which others are pointing as well. But if it didn't solve the problem then there might be somefin wrong with your function. If you want us to troubleshoot it, you need to find the real place of the function where it is defined, you can perform search in your files for the_permalink() function or browse your blog directories to file that has name functions.php
     
    khan11, Jan 9, 2009 IP
  10. Idle Play

    Idle Play Notable Member

    Messages:
    2,787
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    245
    #10
    The issue here is that you're including a link within a link so to speak.

    <?php the_category(', '); ?>
    Code (markup):
    The above function creates the full linking code as opposed to just echoing out the category name, so all you really need is :-

    Filed Under: <?php the_category(', '); ?>
    Code (markup):
     
    Idle Play, Jan 9, 2009 IP