Eric Holmes
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: EVERY Post Misses ScheduleBefore I get started, I’d like to clarify something to you… Google isn’t instantaneous – it will take days, sometimes weeks for your new posts to show up there, so don’t fret over that.
The homepage however, is quite strange. Can you confirm that under the General Settings you have your timezone selected and have updated this settings page?
Forum: Hacks
In reply to: admin-ajax from front end – hook not registeredNo problem. Glad you got it working ??
Forum: Hacks
In reply to: admin-ajax from front end – hook not registeredIs your plugin inside a class? If not, I would STRONGLY suggest changing your function name. edit_post is an already defined WordPress function in the core.
Preferable something as simple as “sfze_edit_post” – something that will never be replicated.
Forum: Hacks
In reply to: admin-ajax from front end – hook not registeredHm.. Not sure then man.
Your jQuery script looks clean (obviously) and it removes any doubts I had previously regarding your enqueueing..
One thing I realized during my last AJAX encounter was I forgot to return a JSON encoded value.
Perhaps a good idea would be to make an extremely simple version of your ajax call, to isolate whether the problem definitely is the php callback for your action, or whether it has to do with the call itself from jQuery.
something as simple as:
jQuery.ajax({ url: ajaxurl, type: 'post', dataType: 'json', data: array(action: 'test_action'), success: function(data, textStatus, XMLHttpRequest) { alert(data.value); }, });
php:
add_action( 'wp_ajax_nopriv_test_action', 'your_public_function' ); function your_public_function($args) { $data = array( 'test' => 'test' ); return json_encode( $data ); exit; }
Forum: Hacks
In reply to: admin-ajax from front end – hook not registeredOkay, for starters don’t put anything in any core files (admin-ajax.php). You can do everything from the THEME level, that way when you update WordPress you won’t lose your alterations (and on that note, use a child theme, or else you will lose changes when you update the theme).
Back to it:
I am assuming the following:
– you are localizing your ajax link onto your own js file which contains a ajax call to “your_action”.
– you have add_action( ‘wp_ajax_nopriv_your_action’, ‘your_function’ );
– you have defined ‘your_function’ and are returning a JSON encoded value.Could you give me an example of your JS code that you are using? After I see that it’s all in order, my only solution for you would be for me to make you a quick example of a working ajax call.
Forum: Fixing WordPress
In reply to: selling same items on ebayVery true, it would.
Your best bet is to contact eBay, or perhaps go extensively searching for a plugin to do what you wish. Currently I know not of any such plugin.
Perhaps a notice saying “For the more up-to-date stock of our store, visite our eBay page” or something like “All Items are not garunteed to be in stock. A refund will be granted if we lack the item you purchase.”
Best to cover your arse!
Forum: Hacks
In reply to: Plugin Options StyleYou need to be more specific in your styling then, to push priority over the default styles.
Example:
if the default style is:
ul { margin:0; }
Use this:
div ul { margin-left: 20px; }
By adding more classes/IDs or even parent tags into the CSS argument, it will rank higher by being more specific – which will override the default styles.
Forum: Fixing WordPress
In reply to: Multisite Crashwell, I have experienced this issue before, and this was the cause:
I was using “current_user_can(‘edit_posts’);”
The issue was I was doing this on a login_redirect hook. When you first go to the /wp-admin, it calls this, but you are not logged in yet. The user the function receives is a WP Error, rather than a WP User.
Do you have this function running anywhere without a check for if the $user is actually a user?
Forum: Hacks
In reply to: Plugin Options StyleWhat hook are you using to implement your css file? Knowing this may help us solve this issue for you.
Forum: Hacks
In reply to: admin-ajax from front end – hook not registeredCan you show me your hook? Please note there are 2 types of ajax hooks:
Admin only:
add_action( 'wp_ajax_{your_action}', 'your_public_function' );
Public:
add_action( 'wp_ajax_nopriv_{your_action}', 'your_public_function' );
These functions set up the AJAX call – your_action is the action defined in your AJAX request.
You also need to localize the ajax script itself.
Admin (dashboard only):
add_action( 'admin_print_scripts-index.php', 'enqueue_scripts' );
Admin (all pages):
add_action( 'admin_print_scripts', 'enqueue_scripts' );
Frotn End:
add_action( 'wp_print_scripts', 'enqueue_scripts') );
Here, the ‘enqueue_scrupts’ is the function that will enqueue the scrip with your AJAX call in it, and localize the AJAX link:
function enqueue_scripts() { // Your actual AJAX script wp_enqueue_script( 'my-script', '/js/script.js', array( 'jquery' ) ); // This will localize the link for the ajax url to your 'my-script' js file (above). You can retreive it in 'script.js' with 'myAjax.ajaxurl' wp_localize_script( 'my-script', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' )));
Forum: Fixing WordPress
In reply to: selling same items on ebayI have no experience with this, Candell, but my suggestion is to have your client contact eBay, and see if there is any way of integrating eBay into their website.
If not, quick solution would be to embed an iFrame which houses your clients eBay store page. That way you wouldn’t have duplicates, it would all go through eBay.
Forum: Fixing WordPress
In reply to: Multisite Edit Site option explanationIn what context? Do they relate to comments, posts, etc?
Edit: Sorry I did not read the topic, clearly.
I have never worked with a multisite before, so I do not know the answer to that, sorry ??
Forum: Fixing WordPress
In reply to: To go back to zeroWell, since you aren’t really sure what you changed, I suggest deleting the directory you installed WordPress in, and re-installing from there. If you installed it through your admin panel (cPanel, Korax Admin, etc.) I suggest you look there at your WordPress Installations – you should be able to uninstall from the same area you installed from (unless you installed it manually).
If you have to remove the files manually, I also suggest going into your phpMyAdmin and removing the database that WordPress created. To find it, go into the wp-config.php file in the WordPress root folder, you will see the database name (and credentials if you don’t know them) to get into phpMyAdmin.
As far as your request about themes, you can definitely have as many as you like, you need to just activate whichever theme you wish to use.
Removing the author, date, and the blogstuff on a post: You need to have some coding expertise to do this. You have to edit the “loop” that creates the blogroll on that page. You will find it in index.php or front-page.php (depends on the theme). Some themes may have theme specific settings to hide such things.
My best advice is to read through the codex thoroughly before trying to do anything with the php files, and the more research the better!
Forum: Hacks
In reply to: posts_where filter is ignoredOne other method you could use (not as clean) is do the filtering right within the loop on search.php
something like:
<?php $array_of_posts_to_exclude = array( 1, 2, 3); while (have_posts()) : the_post(); if( ! in_array( the_ID(), $array_of_posts_to_exclude ) ) : ?> <div class="post"> <?php the_content(); ?> </div> <?php endif; endwhile; ?>
Forum: Hacks
In reply to: posts_where filter is ignoredAND (wp_posts.post_status = ‘publish’ OR wp_posts.post_author = 1
AND wp_posts.post_status = ‘private’)should read
AND (wp_posts.post_status = ‘publish’
OR (wp_posts.post_author = 1 AND wp_posts.post_status = ‘private’))Other than that, I’m at a loss.