Tagged Questions

Ajax - The core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the ...

learn more… | top users | synonyms

1
vote
1answer
149 views

Function call via ajax – can't figure it out?

In my header.php file I've got … <script type="text/javascript"> var ajaxurl = "<?php echo admin_url( 'admin-ajax.php', 'relative' );?>"; </script> In my functions.php file ...
0
votes
1answer
340 views

how to call ajax on frontend of wordpress

In my plugin folder I have two file 1. hello-ajax.php 2. myajax.js and by shortcode I add this form on frontend <form id="theForm" method="post"> <input id="name" name="name" value = ...
1
vote
0answers
39 views

Wordpress P2 live problem

Everything worked perfectly in localhost. When I uploaded everything online, the ajax submission seems to not working. It's refreshing the page for comments and live updated is not working I have ...
0
votes
1answer
117 views

How to render the single post template with the post name?

I'm calling pages with Ajax and I have this code in functions.php to determine which page is called and then, render the corresponding template: function ajax_callback() { if( isset( ...
0
votes
2answers
123 views

Dynamic Gallery

I'm building a single page website and that means that all the links need to call for post content dynamically. I found this tutorial and with the help from some folks from StackOverflow I managed to ...
0
votes
1answer
5k views

Load page content with AJAX using Fancybox?

I can find a lot of tutorials about how to load pages dynamically in WordPress and even page contents, like this: how-to-load-just-the-content-of-a-wordpress-post-using-ajax and Best way to load ...
1
vote
1answer
125 views

Wordpress Plugin Page is Loading in Admin Content Container Instead of Separate Page

I am creating a wordpress plugin that has it's own UI. It looks like a standard web application, so everything that is done within the plugin is handled in this UI instead of integrating it with the ...
0
votes
1answer
200 views

How to load a plugin when doing an Ajax call? [duplicate]

I have posted this question: How to use shortcodes on a widget sidebar when doing an ajax call?, with no answers. Now I want to ask a more specific question. The problem seems to be that the ...
0
votes
0answers
221 views

Loading individual category post via dynamic tabs

I've been searching for a navigation solution for my wordpress site's front page that loads individual categories and their corresponding post through dynamic tabs. These are tabs or buttons that load ...
0
votes
0answers
117 views

How to use shortcodes on a widget sidebar when doing an ajax call?

I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing: add_action( 'init', function() { ...
-1
votes
1answer
48 views

AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page: "http://permalink.comtitle" It's as if all the ...
0
votes
1answer
162 views

jQuery form plugin, submit in the wordpress way

Trying to use jQuery form plugin in wordpress site to upload files. HTML markup: <form id="myForm" action="process.php" method="POST" enctype="multipart/form-data"> <input type="file" ...
0
votes
0answers
257 views

How to use AJAX to check if user is still logged-in?

I am working with Wordpress 3.8 I have an app that I would like to use AJAX to check with Wordpress to determine if their idle time has expired. In my functions.php, I have the following hook that ...
1
vote
1answer
153 views

Help with AJAX front end comment moderation

I am implementing a front end AJAX comment moderation system for a site I manage but I am having a hard time getting it to work. Right now clicking on the link that approves the comment runs the ...
0
votes
1answer
393 views

Next Ajax call doesn't work

I'm submitting a form via Ajax: <form id="ajax-form-next" method="post" action=""> <input type="hidden" name="nextPosts" id="nextPosts" value="<?php echo $postIDs; ?>"/> ...
0
votes
2answers
524 views

Stop loading more posts if none left AJAX

I'm using the following JavaScript to load more pages in #work_items (see live at http://mtthwbsh.com): jQuery(document).ready(function($){ $('.older a').live('click', function(e) { ...
-1
votes
1answer
63 views

A refreshless WordPress website

As I said in my previous post, I am totally new in the WordPress world. My knowledge of PHP, Css, HTML and JavaScript is a little old but I am sure I can do this by my own with some guidance. Please ...
0
votes
0answers
71 views

Hook ajax function to child class

I have three different classes, the main one, the back-end class and a front-end class. The front-end class should handle the ajax request, so I was planning on placing the ajax code inside that ...
-2
votes
1answer
67 views

Send button using own contact form [closed]

I have an own contact template here , und built it according to this info. The submit button does not work because another event seems to block the reload of page. Looking in the console, I see an ...
0
votes
0answers
16 views

How to use ajax_url in front end when using with theme? [duplicate]

I'm trying to use ajax function to my theme. I think i can't just put the javascript code in my functions.php, i have to register it properly and enqueue it. So i store the javascript file with .js ...
0
votes
2answers
230 views

WP_LOCALIZE_SCRIPT doesn't work

I am creating AJAX loading and need to use WP_LOCALIZE_SCRIPT but cannot make it work. Here is my code. I place it in functions.php wp_enqueue_script( 'page_data'); $gallery_js_data_array = array( ...
2
votes
2answers
491 views

Wordpress Ajax Getting Response “Null”

I am trying to get ID of post on HOME page .So far my coding is wp_enqueue_script( 'my-ajax-request', get_stylesheet_directory_uri() . '/js/ajax.js', array( 'jquery' ) ); wp_localize_script( ...
0
votes
1answer
1k views

Insert Post using Ajax

I'm using the following code to submit a form from a Wordpress page. <script type="text/javascript"> $j=jQuery.noConflict(); $j(document).ready(function(){ ...
0
votes
0answers
58 views

Ajax Not Working If The Handler is Located Outside Plugin Submenu Page Function

I am using wordpress ajax to trigger a submission. I located the submission code in the submenu page, because of it is have conflict with the function in plugin main page. The problem here is, I ...
0
votes
0answers
128 views

How can I include scripts in a jquery loaded page, for a jquery wordpress widget?

Iam writing a wordpress widget with the following pages 1) I have master page (master.php) - is the main plugin page - Loads a second page (slave.php) with jQuery 2) The slave page - has php, ...
0
votes
0answers
199 views

Custom URL structure with external web service

I have WordPress site which displays content from database, but I also want to consume .NET web service hosted on the Windows Azure and fit the content inside the WordPress. URL structure of ...
1
vote
2answers
104 views

Access the environment of an admin page from another admin page

I've been busy thinking about a problem, and so far I didn't find a solution to it. The abstract scenario On admin page A, I would like to print the value of a (global) variable—in the context ...
1
vote
2answers
962 views

AJAX returns response 0

I'm trying to get user profile values using an AJAX call, but the response is always 0. Here's my PHP: wp_enqueue_script( // Add JS to <head> 'cc-author-change-post-author', ...
0
votes
1answer
2k views

Ajax page load without reload

I am working on a script to load my page without refreshing. It is working as I want it except for one thing. The test site I have up is http://dev.dog-company.com . Only home About us and FAQ will ...
0
votes
0answers
15 views

Alternative ways to make ajax requests in wordpress [duplicate]

I'm currently having a problem with working with AJAX. Well not really a problem since I can pretty much do what I want to do. The only problem is my boss saying that the admin-ajax.php file is an ...
1
vote
0answers
258 views

How to populate custom field dropdown box based on prior selection?

I have two dropdown boxes for a search that uses custom fields and I need the second dropbown box to be populated depending on the results of the first box. So far I have: <form role="search" ...
0
votes
3answers
157 views

Get post offset/posts page offset in single post page (outside the loop)

I would like to know how I could get the offset of a custom post or its page, outside the get_posts loop. I developed an external web application which connects to the wordpress blog with JSON API ...
0
votes
0answers
723 views

Update user meta using Ajax on front end?

I would like to update some user meta information from the front end of a WordPress page when the user clicks on a button. I am attempting to pass along a string of data, and then updating the field ...
0
votes
0answers
85 views

Ajax Request not coming back to class

I'm struggling with an ajax request. It's executed but not returning back to my class. My PHP: ... public function __construct() { add_action( 'admin_print_styles', ...
0
votes
1answer
449 views

get content from page through AJAX

I'm using an wordpress theme and I want to load content through AJAX inside a page. I've added this inside my functions.php : function my_ajax_files() { wp_localize_script( 'function', ...
1
vote
1answer
70 views

Ajax simple experiment

I want to output the post id. But I am receieving null... In footer.php <script> jQuery("a.more-link").live('click', function(event) { event.preventDefault(); jQuery.ajax({ ...
0
votes
0answers
123 views

Remove dashboard access but allow ajax file upload

I want to restrict dashboard access for users with a custom user role. The code works fine, and i can perform custom ajax requests successfully, howeverim not able to upload a file using the wp.media ...
0
votes
0answers
75 views

Wordpress MU and Media Uploader issue

Ok, a bit longer question here: I have WP MU and I have a page on main domain from where blog admins can update/manage their pages/posts. so it looks like: www.MainDomain.com/members On that page I ...
0
votes
1answer
45 views

retrieving page content per AJAX [duplicate]

I am currently working on a single page website. I am trying to retrieve the page content via AJAX. The page URL is http://mylocalserver/sad/wp/clients. $.get( ...
4
votes
1answer
104 views

Is having multiple theme customizers for different pages possible?

If you have a theme that for instance has a blog, front page and misc pages is it possible to have more than one theme customizer, so that you can provide a live preview when editing styles? My theme ...
0
votes
0answers
118 views

AJAX hash change problem

I am using All AJAX theme by Cheris Coyier. But I want to change the URL. Current URL http://localhost/wordpress/#/wordpress/sample-page/ and I want to replace #/wordpress/sample-page/... My code for ...
2
votes
0answers
3k views

AJAX with loop filtering categories

I've been researching on how to make my loop with AJAX. I found some codes online and modified some parts but I can't seem to get it to work. This is my code for the loop: <article id="main" ...
0
votes
1answer
89 views

Ajax navigation and scripts loaded only on certain pages

I'm building a theme. The theme post navigation is done through jQuery Ajax. I've been several plugins to see compatibility and I have a problem with the Ajax functionallity. Some plugins such as ...
0
votes
1answer
438 views

Run again current query via ajax but changing a var

I have custom query which is $query. The input is based on form input. The query has already run on a page, but after that I'd like to run it again without a page reload, so with AJAX (when the users ...
0
votes
1answer
664 views

Load more posts (Ajax) in tabbed sidebar on single.php

I'm trying to use this approach http://wordpress.stackexchange.com/a/56349/18144 to create a 'load more' button in the sidebar on single.php. I would like to able to load more posts in a sidebar tab ...
0
votes
1answer
98 views

ajax in admin menu

Following the tutorial listed here, I'm the data isn't being saved to the user meta I'm trying to set. The process itself seems simple enough, but the meta data isn't being saved. I don't get any ...
0
votes
0answers
301 views

fail to load /wp-admin/admin-ajax.php locally

I have the same problem as here, in that all ajax functionality has suddenly stopped working. In the browser dev tools it gives the error as failed to load resource for wp-admin/admin-ajax.php With ...
0
votes
0answers
200 views

Nonces and Cache

It's clear that form submissions and AJAX requests, especially sensible ones, need "nonces" to avoid certain exploits. However, with heavy use of caching systems it becomes harder to generate them ...
0
votes
1answer
28 views

Build and ajax plugin not work

I have this code on a plugin function ajaxp_init(){ /* * registro del script */ wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', ...
0
votes
0answers
92 views

Unable to show messages using 'admin_notices'

The plugin I am working on has a table in the admin area with a single entry corresponding to single row. The admin has an option to perform certain actions on the table contents one of them being ...