What is the proper way to get contents of a page?

A few notes before I start NEVER EVER use php shortcodes, they are bad, confusing and not supported by default on some servers. IMHO, they should have never made it into PHP in the first place. WordPress Standards (which doesn’t mean much) also “prohibits” the use of shorttags. Use proper php tags and forget that … Read more

Grabbing specific content

First of all learn WP_Query class. Answering on questions: (this question) How do I grab the nth element of a content type? eg. always getting the 1st or 5th most recent element from the db. $query = new WP_Query( ‘post_type=special_stuff&posts_per_page=1&paged=5’ ); List item // The Query $the_query = new WP_Query( $args ); // The Loop … Read more

wp_insert_post iframe missing

remove_filter(‘content_save_pre’, ‘wp_filter_post_kses’); remove_filter(‘content_filtered_save_pre’, ‘wp_filter_post_kses’); $id = wp_insert_post( $my_post ); add_filter(‘content_save_pre’, ‘wp_filter_post_kses’); add_filter(‘content_filtered_save_pre’, ‘wp_filter_post_kses’);

how load content as pop-up using ajax

If you want to load PHP file through AJAX use the below code. function sendAJAX(){ $(‘#container’).load( “stuff.php”, // url { // json object of data to pass to the page stuff: “all your stuff goes in here…”, moreStuff: “even more stuff” }); console.log(‘sendAJAX’); }; Let me know, In case of any doubts.

How to retrieve the content (with a specific ID) via ajax by clicking a link tag

I would put the action in the post data $.ajax({ url: “/wp-admin/admin-ajax.php”, type:”POST”, data: { action: “my_custom_data”, post_link: post_ID }, success: function (response) { console.log(response); $(‘#post-data’).append(response); } }); return false; ….. Then use $_POST[‘post_link’] in your PHP function my_custom_data(){ $post_link = $_POST[‘post_link’]; echo get_the_content($post_link); die(); }

plugings request url is the old url

No, that should be enough. Elementor sets its base URL ELEMENTOR_URL from plugins_url plugins_url uses WP_PLUGIN_URL which is set in default-constants.php WP_PLUGIN_URL is constructed from WP_CONTENT_URL which is constructed from get_option(‘siteurl’) there’s a default options_siteurl filter called _config_wp_siteurl that overrides the value fetched from the database with WP_SITEURL if set. So assuming you don’t have … Read more

Capitalize All Titles and Headlines in Chicago Style

I took a look a Tom’s plugin that you referenced and made a stripped down version that simply runs post titles through the Title_case class on-the-fly. I tested it out, and it works. Unlike the original plugin, the code below just changes titles before they are displayed and not when saving posts. Plugin structure: /wpse-title-case/ … Read more