Custom PHP App with a wordpress site

Assuming you have a page with the slug “teaching-portal”, this plugin adds a rewrite rule for that page that allows one part to be added after it in the URL, what you refer to as “mygetdata”. I’ve called it “lesson”. <?php /** * Plugin Name: Custom PHP app on teaching-portal page * Plugin URI: http://wordpress.stackexchange.com/questions/75991 … Read more

Filtering a Database Query

The table wp_options can normally be queried using get_option() So you can use something like $testimonial_settings = get_option(‘testimonial_settings’); to retrieve the values of testimonial_settings. If the stored value is serialized, it will be retrieved as an array.

How to make widget title accept php?

You can use the filter widget_title and a “virtual” shortcode. Of course, as One Trick Pony points out, the “why” (and the “what”) is essential to find a proper solution… Supposing the widget title was Title [php] More Title: add_filter( ‘widget_title’, ‘pseudo_php_wpse_90360’, 10, 3 ); function pseudo_php_wpse_90360( $title, $instance, $id_base ) { if( FALSE === … Read more

Create a Blog Template Page

Why reinvent the wheel? Just create archive-{posttype}.php, and ensure that ‘has_archive’ is set to true for the post type. If your post type is event: archive-event.php. Then, WordPress will handle the query automatically. If pretty permalinks are enabled: example.com/{posttype} …will display the archive index page for {posttype}.

How to show a users bio on a page

WordPress already comes with the author page/functionality. Let’s say you have the author john on your site www.example.com, then you’d see his author page at www.example.com/author/john. If you want to customize this, you have to tweak (or maybe even create, depending on your theme) the author.php or other author template files.

How to edit php code in WordPress Post file?

You should never ever modify WordPress Core files. WordPress has an Plugin API (http://codex.wordpress.org/Plugin_API) that allows you to modify WordPress to your liking without changing Core code. In your case, the solution is to check the contents of the custom meta box fields before they are saved via the save_post action. If the content is … Read more

Saving zero in meta box

Your issue seems to be with too loose logic check, rather than saving. To treat valid but falsy value correctly you need something like this: if ( false !== $meta_value ) This will strictly match only the case when value doesn’t contain false (return of the API when fetch failed).