wp_get_current_user always returns 0 continued
To use wordpress functions outside the context of the wordpress environment, you can include wp-blog-header.php, so in the context of test.php: require(‘./wp-blog-header.php’);
To use wordpress functions outside the context of the wordpress environment, you can include wp-blog-header.php, so in the context of test.php: require(‘./wp-blog-header.php’);
<?php $current_page_id = get_the_ID(); wp_list_pages(“child_of={$current_page_id}&sort_column=menu_order&title_li=”); ?> Please check the above code
You shouldn’t be calling get_the_ID() outside of a post loop, and the post ID is handed to you using the filter as a function argument: function insert_new_table( $post_id ){ So use $post_id Added notes Don’t use mysql_connect etc that extension was deprecated and is no longer included by default in newer versions of PHP. This …
There is almost never a scenario where executing PHP code entered from the wysiwyg editor is a good idea. It opens up a whole bunch of security issues. The best way to achieve what you are looking for is to setup a custom short code that will return the link you are interested in. Add …
I’m not sure how to get it via the title, but you can get it via the slug (which is often more useful in my experience) using this: http://erikt.tumblr.com/post/278953342/get-a-wordpress-page-id-with-the-slug Just change “$page” to “$post” if you want to return slugs for posts instead of pages. G’luck!
The problem is this part: wp_get_attachment_image_src($image, ‘large’)[0] In old PHP versions like 5.3 and below, you cannot reference an entry ([0]) from the returned array of a function. The problem is that WP Engine is still on PHP 5.3, which reached end of life recently and doesn’t get security updates anymore. For the history see …