I want to access WordPress functions from outside WordPress. I have included file wp-load.php in my non-WordPress code. It is working fine for a single WordPress install, but in my project I have two different WordPress installations - one for the blog and one for resource. When I try to insert a user in the resource install, it uses the blog install's database because the blog install's wp-load.php is loaded first. Therefore, I am unable to insert users in blog. …
I have a WordPress website. I want to split my existing database into two parts and store in a remote database. How can I set up a remote database connection for existing WordPress? If it's not possible to split existing database, how can I connect a remote database for future records? Thank you.
I have already seen that we can call wordpress outside wordpress installation. but I am always curious if this approach cause website to load slow. I don't want to enable multisite. Is there anyone willing to guide me.
I'm unable to load wp-load.php file from wordpress in my ADD ON DOMAIN. I am using require_once('./wp-load.php'); to load wp-load.php and get_header(); to load header in my php file. Primary Domain is loading wordpress functions fine but add domain is not, it is not throwing up any error. <?php require_once("../wp-load.php"); ?> I am expecting to load wordpress function in my php file on Add domain like the way Primary domain loads
I'm using a plugin on Site A that shows announcements. I would like to put the same plugin on a different site (Site B), and have it pull the data from Site A, so that both sites show the same announcements simultaneously, based on the data that was entered on Site A. As I read the code in the plugin, I see that they are using this line to get data from the DB: $options = get_option( 'announcer_data' ); I …
Basically I want to use wordpress functions for example wp_create_user() or wp_update_user() outside of wordpress (outside of wordpress directory). I tried with all the below code snippets to load the wordpress environment, I am able to use the functions correctly in both the cases but the problem is that this also loads the wordpress template which I do not want. First Method: <?php define('WP_USE_THEMES', false); require ('../blog/wp-load.php'); ?> Second Method: <?php define('WP_USE_THEMES', false); require ('../blog/wp-blog-header.php'); ?> Directory Structure: /blog | …
I create a plugin and install it in any wordpress sites. For any reason I need to call a function on those plugin from another site (not wordpress site). I've already try to using cURL and file_get_contents to call the function, in some wordpress site it's worked well, but in some another wordpress site it's not working. It's failed on calling the function because the wordpress site has the redirect URL or the wordpress site has another plugins installed like …
The WordPress area of my site (which has registration) is in for example mydomain.com/members/ I would like to know from a PHP routine in my public_html root mydomain.com/offers.php if they are logged into the WordPress area mydomain.com/members I have tried various things to try and get this to work without success. get_current_user_id() always returns 0 or is_user_logged_in() returns false. If it helps to give me the correct solution, my WordPress uses the theme MH-Magazine, and uses the plugins Paid Memberships …
I´m trying to do an simple Wordpress-App for my Homepage. I started using Appery.io, which is actually a good environment for a non-programmer. But I wonder if anybody has experiences in hooking up a Wordpress Site to an App by Appery? Where would I start? What my basic needs are: 1) Read the Articles 2) Comment on Articles directly in-App 3) Push-Notification about new article/comment
So following on from this post: https://stackoverflow.com/q/1463480/1086990 I was wondering how exactly it would work integrating it into Wordpress. I have a custom post type setup, and so far I have tried both linking to a "ical.php" with the above link code (and changing the title into the_title() and the dates into GMT versions of my date(..) code). None work, because it can find the get_post_custom_values() which is obvious since not in WP loop, or a WP associated file. Next …
I have a wordpress website and I want to use wordpress menu outside the installation. So I created a file called nav.php and put the following code include( '../wp-load.php' ); wp_nav_menu( array( 'theme_location' => 'primary','menu_id' => 'cartel' ) ); In the header on another website, <?php echo file_get_contents('http://example.com/nav.php') ?> This ignores the menu item having custom link created in the WordPress menu. Please help. for example (SHOP [/shop/])
We have a Raspberry Pi running PressPi which is a wordpress server. Our goal is to setup a Captive Portal using dnsmasq where users who connect to the Pi using a USB WiFi adapter see the PressPi home page when they attempt to surf the web. /etc/networks/interfaces (Rasbian) has been configured with a static IP address and correctly leases an IP address to clients. When these clients navigate to the PressPi server using the Pi's IP address, they see a …
I am trying to trigger an add_action hook (add_action("wpcf7_before_send_mail", "add_data_to_custom_table");) from outside the wordpress loop. The add_action hook is defined in theme's functions-custom.php. in domain.com/test.php i have define('WP_USE_THEMES', false); define('WP_CUSTOM_TABLE', 'test_table'); /** Loads the WordPress Environment and Template */ require( '../wp/wp-blog-header.php' ); include('../wp/wp-content/themes/customtheme/incs/functions-custom.php'); <?php echo do_shortcode('[contact-form-7 id="417" title="Test Contact Form"]'); ?> In this setup the add_action hook is not working. If however i move the add_action hook definition to the theme's functions.php it does work. My question: how can i …
I need to be able to tell if an admin is logged in ouside of the loop. This is needed for some php files that are part of a WP site but do not use require( '../wp-load.php ); What I need to do is keep the Google Analytics tracker JS from firing for logged in admins, but track everyone else. How do I find out if an admin is logged in outside of the loop? Checking the WP logged in …
I made a sidebar in wordpress and have widgets in it, I want to process them one by one so that I can set their locations in theme according to me. Example: If I have a 3 widget in my footer sidebar, they come in one row and if fourth came it goes to next row but in the centre. Secondly if there is only one widget in sidebar it comes in the centre of first row. I am using …
I have a member site which maintains a collection of books. I want to have a page on a folder outside of my loop that can see if the user is logged in to the main site, and then display the book viewer. If the user is not logged in to the main site, display a different page. I think I am having some trouble with cookies. I installed the Root Cookie Plugin, to help This is the code I've …
I recently incorporated a new interface into my wordpress site that mimics an iGoogle layout. (If interested, It can be found here: Link and DEMO ) It uses several widgets to make up the layout that are added dynamically. The way to edit these widgets come from a file called widgets_rpc.php. I want to add another plugin I have, which allows users to edit text that is wrapped in a shortcode - [ce_sc did="1"][/ce_sc]. When some text is wrapped in …
I have a static website and WordPress installed at mywebsite.com/blog. I have a page on my external static website which displays a list of all posts [per the codex][1] using the following code <div class="container" id="blog-home"> <div class="col-md-8 col-sm-8 col-xs-12"> <?php $args = array( 'numberposts' => 10, 'post_status'=>"publish",'post_type'=>"jobs",'orderby'=>"post_date"); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <div class="post"> <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <p><?php the_date(); ?></p> <p><?php the_excerpt(); ?></p> </div> <?php endforeach; …
I am outsourcing the wordpress and I already figured out the external view. I even know how to make a WP query for previews, but when I want to do that I simply cant - wp-load stops all operations and I get something like "You do not have permission to preview drafts" - any idea what might cause that? (Its the same hosting, and I am correctly logged in.) - so my guess is that wordpress checks for some part …
I am making a new template and I need to place the comments template outside the wordpress loop and just above the footer in the single.php file. I searched on google and the best answered I could find related to my issue is in this link: https://stackoverflow.com/questions/6384205/displaying-the-wordpress-comments-template-outside-the-loop However, that did not work. The same comments are appearing on all posts. So, how can I display the comments display outsite the wp loop? EDIT: This is the single.php file <?php get_header(); …