Title: a quick php/html question..
Last modified: August 18, 2016

---

# a quick php/html question..

 *  [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/)
 * how should i change this:
 * a href=’post.php?action=edit&post=$post->ID’
 * so that rather than edit the post, it simply goes to it?
 * (i’m optimistically attemting to hack x-dashboards ‘latest activity’ page)
 * cheers
 * opaz

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290113)
 * sorry wrong category – i blame the mouse roller
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290125)
 * [moved to How to…]
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290129)
 * Try
 * a href=’/?p=$post->ID’
 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290135)
 * nah – it doesnt like that. the whole code segment is:
 * <?php
    }
 *  if ( $recentposts = $wpdb->get_results(“SELECT ID, post_title, post_content 
   FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date_gmt < ‘$today’ 
   ORDER BY post_date DESC LIMIT 5”) )
    { ?> <div style=”float:right;width:33%;”
   > <h3><?php _e(‘Recent Posts’); echo ” »“; ?></h3>
    -  <?php
       foreach ($recentposts as $post) { if ($post->post_title == ”) $post-
      >post_title = sprintf(__(‘Post #%s’), $post->ID); echo ”
    - ID’>”;
       the_title(); echo ‘‘.substr(strip_tags($post->post_content),0,150).’[…]
    - ‘;
       } ?>
 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290137)
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290140)
 * Try posting your code here:
 * [http://paste.uni.cc/](http://paste.uni.cc/)
 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290149)
 * good plan. i’ve done as you suggest. cheers
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290152)
 * 😉 then post back with the URI you got after pasting it to the paste.uni.cc
 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290156)
 * ah see what you mean lol.
 * [http://paste.uni.cc/8312](http://paste.uni.cc/8312)
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290300)
 * Well, same here, and my suggestion works. I change:
 * `echo "<li><p><a href='post.php?action=edit&amp;post=$post->ID'>";`
 * to:
 * `echo "<li><p><a href='/?p=$post->ID'>";`
 * This also works:
 * `echo "<li><p><a href='/index.php?p=$post->ID'>";`
 * Just make sure the url is correct for your blog. This more complicated version
   should avoid any problems:
 * `echo "<li><a href='" . get_bloginfo('home') . "/index.php?p=$post->ID'>";`
 *  Thread Starter [opaz59](https://wordpress.org/support/users/opaz59/)
 * (@opaz59)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290364)
 * I used the first one and it seems to work perfectly. I thank you.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘a quick php/html question..’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 3 participants
 * Last reply from: [opaz59](https://wordpress.org/support/users/opaz59/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/a-quick-phphtml-question/#post-290364)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
