Click loads template via ajax
So, you’re using wp_localize_script to inject the ajax url. But you didn’t use the localized var handle to access that value. Try this: /* … */ $.ajax({ url: ajaxStuff.ajaxurl, // NOTE use of ‘ajaxStuff’ object /* … */
So, you’re using wp_localize_script to inject the ajax url. But you didn’t use the localized var handle to access that value. Try this: /* … */ $.ajax({ url: ajaxStuff.ajaxurl, // NOTE use of ‘ajaxStuff’ object /* … */
Use the Co-Authors Plus to assign the authors and the post will show automatically on both author pages. I’ve used it and works pretty well.
Try this: if ( ! function_exists( ‘customField’ ) ) : function customField($name, $id=false, $single=false){ global $post_type, $post; $name=trim($name); $prefix=”; // only if you need this $data=NULL; if($id!==false && !empty($id) && $id > 0) $getMeta=get_post_meta((int)$id, $prefix.$name, $single); else if(isset($post->ID) && $post->ID > 0) $getMeta=get_post_meta($post->ID,$prefix.$name, $single); else if(‘page’ == get_option( ‘show_on_front’ )) $getMeta=get_post_meta(get_option( ‘page_for_posts’ ),$prefix.$name, $single); else … Read more
Following code snippet replaces placeholder menu item from ‘your-menu’ menu. add_filter( ‘wp_nav_menu_items’, ‘add_item_to_menu’, 10, 2 ); function add_item_to_menu( $items, $args ) { if ( $args->theme_location == ‘your-menu’ ) { $link_text = “My Replaced Link Text”; $link_url = “my-replaced-link-url.com”; $items = str_replace( ‘lang_placeholder_text’, $link_text, $items); $items = str_replace( ‘lang_placeholder_url’, $link_url, $items); } return $items; }
Upon further investigation, I found that the answer to my problem involved one simple, yet easy to overlook fix: I needed to add this new site to my hosts file.
You are using the filter wrongly, that is why you might not get the desired result. Lets first look at the template_include filter which you can check out in wp-includes/template-loader.php (current version 4.3.1) 44 if ( defined(‘WP_USE_THEMES’) && WP_USE_THEMES ) : 45 $template = false; 46 if ( is_404() && $template = get_404_template() ) : … Read more
The term you need to search for is “Pingbacks” (and maybe “Trackbacks”, but the former is better as it is less vulnerable to spam abuse). It is an XML-RPC request. You can find the specification here. Looking at github there seem to be some bare metal PHP implementations, but as I haven’t used any of … Read more
I don´t know why you would want to slow your website down, but PHP got sleep() which pauses a program for the amount of seconds you pass to it. You could then hook your function/plugin to init to halt your WordPress before it starts its output. That could probably do what you want. But why?
Here is an example of getting the user IDs, looping through each, grabbing a meta_key as an array, adding new values to it and remove old values, saving the meta back, then grabbing it again to loop through each item in the array for output. Array is just an example of duplicate keys. $user_query = … Read more
You can use the WP REST API plugin to add/manipulate/present media of a WordPress install from within your app. The page creation part I am not sure of, perhaps it’ll need to be done manually – or you can create pages via the /pages/ endpoint. I’ll let someone correct me if I’m wrong, but the … Read more