Formating the display of a post’s date, outside the Loop

I’m using this function to be able to retrieve several data, from outside the Loop: function get_post_data($postId) { global $wpdb; return $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE ID=$postId”); } … and then, this to display the date a post was published: <?php global $wp_query; global $thePostID; $thePostID = $wp_query->post->ID; $data = get_post_data($thePostID); echo $data[0]->post_date; ?> wich … Read more

Format XML string to print friendly XML string

I have an XML string as such: <?xml version=’1.0′?><response><error code=”1″> Success</error></response> There are no lines between one element and another, and thus is very difficult to read. I want a function that formats the above string: <?xml version=’1.0′?> <response> <error code=”1″> Success</error> </response> Without resorting to manually write the format function myself, is there any … Read more

Set TextView text from html-formatted string resource in XML

I have some fixed strings inside my strings.xml, something like: <resources> <string name=”somestring”> <B>Title</B><BR/> Content </string> </resources> and in my layout I’ve got a TextView which I’d like to fill with the html-formatted string. <TextView android:id=”@+id/formattedtext” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”@string/htmlstring”/> if I do this, the content of formattedtext is just the content of somestring stripped of … Read more

Get last seen date/time in wordpress get_comments() [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 4 … Read more