JohnC28
Forum Replies Created
-
That’s fine, but it would be nice to stick a few hooks in your code so that it can be extended.
I should have said “That’s understandable” – in my case it’s not fine as I want to override without messing up the plugin!!! 🙂
Hi
I want to add a completely different type of field (one that calculates and confirms the form users’ lat/lon).
The code to do that I have, but I can’t find a neat way of slotting it into your plugin.
In views.php (line 496) you call this:
return wpbdp_render('listing-form-fields', array( 'validation_errors' => $validation_errors, 'listing_id' => $this->_listing_data['listing_id'], 'fields' => $fields, 'recaptcha' => $recaptcha ), false);…the false preventing any override. That’s fine, but it would be nice to stick a few hooks in your code so that it can be extended.
All the field types (checkbox, text etc) are hard coded to render.
I want to do something else (in this case a hidden field with a Google Map).
JC
Forum: Fixing WordPress
In reply to: Malware On Site?PS Backup first of course, but if you do fix it, then junk that backup and do another one.
Forum: Fixing WordPress
In reply to: Malware On Site?If you really have got malware, you need to delete ALL the files in your WP root, wp-admin and wp-includes folder and re-install the current version. If you’re not using the current version, install that first.
I had a client with a malware problem recently and this fixed it.
If you still have a problem after that, then it must be in your wp-content folder. So disable plugins one at a time until you find out which it is.
If it’s still there, it could be in your theme. Hopefully, you know the files there well enough to go through them and see if you can find the problem.
If you know which site you’re being redirected to, it might worth a text search through all files to find a reference to that, but the likelihood is that any real malware will obfuscate it’s action so that won’t turn anything up.
JC
Forum: Fixing WordPress
In reply to: how to get the ID the page parentThis page tells you everything you get back – I think your answer is in there.
Forum: Fixing WordPress
In reply to: how to get the ID the page parentThis should do it:
$page_id = 1; //replace with whatever page id you want to check $page_data = get_page( $page_id ); $parent_id = $page_data->post_parent; // Get Parent if( $parent_id != null) { $page_data = get_page( $parent_id ); $title = $page_data->post_title; // Get Parent title }Forum: Fixing WordPress
In reply to: Malware On Site?Works OK for me too in Chrome and IE.
Forum: Fixing WordPress
In reply to: How to show user_name?Try this
<?php if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); echo 'welcome '.$current_user->user_login; wp_register(); } wp_loginout(); ?>Forum: Fixing WordPress
In reply to: How to show user_name?Try this
`
<?phpwp_register();
?>
<?php wp_loginout(); ?>Forum: Fixing WordPress
In reply to: Multiple loops, Pagination not working properlyHi Nivosh
I’m not certain that I understand your problem, it sounds like you’ve got more than one loop and you want to out put “Next Page” links for the 1st look AFTER you have you displayed the 2nd loop. Is that correct?
If so, couldn’t you capture the “next page” links into a variable immediately after the 1st loop so that you get its posts and then display that variable’s contents when you want to?
You might need to use wp_link_pages as that has an option to echo or return the result.
Forum: Fixing WordPress
In reply to: MySQL queries taking too much timeI agree that the query is inefficient in defining an unnecessary ID filter (also the post_status IN (‘publish’) is fractionally less efficient than post_status = ‘publish), however, I’ve run this query on my largest WP install (roughly 8,500 posts) and it runs in 0.003 seconds on average (with little improvement after removing the long IN list.
I think your problem lies elsewhere.
John
Forum: Fixing WordPress
In reply to: Pagination fails with custom post type (404)UPDATE
If I add ?post_type=MY_CUSTOM_POST_TYPE onto the URL, the pagination words….but only for the first 4 or 5 pages (and there are lots more pages).
Ideas anyone?
Thanks
John
Forum: Fixing WordPress
In reply to: Twitter-Like Time AgoYou need the PHP DateInterval class.
Use it to get the difference between now and the post date (get_the_date() from WP3 onwards) and then a set of if statements to determine which format you want:
Pseudo:
if < 60 seconds
n seconds ago
if < 60 minutes
n minutes ago
if < 24 hours
m hours ago
else
dateGood luck.
JohnForum: Fixing WordPress
In reply to: Twitter-Like Time AgoI am looking to create something myself, not a plugin
Sure, but download the plugin and then pick up the code from there….
Forum: Fixing WordPress
In reply to: Creating a vendor directoryI’d need to do a custom form
You certainly don’t want to go exposing the admin area to anyone/everyone.
It sounds like an interesting project, one that’s probably got potential as a plugin if you can make it generic enough.
Best of luck.
John