WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Recent Posts are all linked to the First Blog.. (18 posts)

  1. multitable2010
    Member
    Posted 2 years ago #

    Hello there! I could really use some guidence here. I need to edit the links in the "Recent Posts" as they are all linking back to the first blog that we ever created. I am not sure what source i should edit to link accordingly.

    Few things you should know:
    1) Customized Theme
    2) http://www.heightadjustableworktable.com/blog/

    Any assistance would be most helpful. I've been looking for this source all day!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    are you using widgets in the sidebar or is that hardcoded?

    if hardcoded, what is the code?
    please paste the full code of the sidebar template into a http://pastebin.com/ and post the link to it here.

  3. multitable2010
    Member
    Posted 2 years ago #

    We are using widgets. I am not sure if it is hardcoded or not. It must be because i had messed with other widgets from the Admin Panel, but they would not appear on the blog. (Assuming because of the customized theme). Can you tell me the directory where i would find such code? (assuming it is hardcoded.)

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    'normally' you would check for sidebar.php under:

    dashboard - appearance - editor - Sidebar (sidebar.php)

    however, as your theme is 'hand-made' it could be anywhere...

  5. multitable2010
    Member
    Posted 2 years ago #

    Here is the sidebar.php within the Theme folder

    Click Here

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    change line 121 to:

    <td width="90%" align="left" valign="top" class="textmatterright"><a href="<?php echo get_permalink($row1['ID']); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), esc_attr($row1['post_title']) ); ?>" rel="bookmark" class="textmatterrightlink"><?php echo $row1['post_title']; ?></a></td>

    and the same in line 166

  7. multitable2010
    Member
    Posted 2 years ago #

    Thanks for the advise Alchymyth.

    When i change this code, now you cannot see the Names of the Recent Posts and nothing to click on. Would this change if a new blog is posted? (As in from here on out) Or should it have pulled up the recent posts already?

  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the code again (tested in local test blog):

    <td width="90%" align="left" valign="top" class="textmatterright"><a href="<?php echo get_permalink($row1['ID']); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), esc_attr( $row1['post_title'] ) ); ?>" rel="bookmark" class="textmatterrightlink"><?php echo $row1['post_title']; ?></a></td>

    please paste the full code of sidebar.php after your edits again and post the link to the pastebin here.

  9. multitable2010
    Member
    Posted 2 years ago #

    Tried it again, same results. :(

    Click Here to view the edited code.

  10. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    my mistake, i was not very clear in my suggestion:
    'and the same in line 166' meant to adjust the code in the same way - not to paste the same stuff;

    the query for line 166 is different, and therefore line 166 should look like:

    <td width="90%" align="left" valign="top" class="textmatterright"><a href="<?php echo get_permalink($row['ID']); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), esc_attr( $row['post_title'] ) ); ?>" rel="bookmark" class="textmatterrightlink"><?php echo $row['post_title']; ?></a></td>

  11. multitable2010
    Member
    Posted 2 years ago #

    Thank you, Thank you, Thank you! You saved us!

    It works like it should.... now.... i just need to get the "Tags" to link up correctly. Any idea where i should start with that?

  12. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    get the "Tags" to link up correctly.

    what tags?
    can you point to the area where the tags are?

    (the post tags below the posts are linking correct as far as I can see)

  13. multitable2010
    Member
    Posted 2 years ago #

    I apologize. It is listed in the same Sidebar, but under "Categories". The kicker is, those aren't Categories. They are the tags we use.

    *shakes head in confusion*

    So the "Categories" a.k.a Tags, don't link up to another post.

  14. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    So the "Categories" a.k.a Tags, don't link up to another post.

    they would link to a archive page - which some of these category links seem to do (check 'Health News' for instance).

    if you want Tags in that list, you need to re-code the section starting with line 199 -
    as I still haven't totaly understood what you want to show in that list, I am unable to help;
    possibly try to contact the original programmer of your template to discuss that.

  15. multitable2010
    Member
    Posted 2 years ago #

    We prefer them to be an actual Category, since the tags are already on the blogs themselves.

    I wish we could locate the programmer. Unfortunately, that is why I am taking this project over.

  16. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    replace line 200:

    $sql="select * from wp_terms";

    with:

    $sql="select * from wp_term_taxonomy WHERE taxonomy = 'category' AND count > 0";

    and replace line 211:

    <td width="90%" align="left" valign="top" class="textmatterright"><a href="?cat=<?php echo $result['term_id']; ?>" class="textmatterrightlink"><?php echo $result['name']; ?></a></td>

    with:

    <td width="90%" align="left" valign="top" class="textmatterright"><a href="<?php echo get_category_link( $result['term_id'] ); ?>" class="textmatterrightlink"><?php echo get_category( $result['term_id'] )->name; ?></a></td>

    that should give you a list of category links

  17. multitable2010
    Member
    Posted 2 years ago #

    GENIOUS!!! We here at MultiTable sincerely thank you for your help. I have been racking my not so PHP friendly mind trying to fix this. Thank you so much!

  18. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    you are welcome -

    please mark this topic as 'resolved' if you have no further questions.

Topic Closed

This topic has been closed to new replies.

About this Topic