New answers tagged

1

WordPress uses the options API to save these settings. All you need to do is find the setting name and its value. In your case it is as follows: //Option name - Value //This corresponds to 'Front page displays' show_on_front - posts/page //This corresponds to the Static page: Front page name page_on_front - <page id> //This corresponds to the Posts ...


0

UPDATE I figured this out. I took help from wp-admin/options-reading.php. Here is the sample code. It's only adding the option to select a page to set as a front page on my theme options. add_menu_page('Menu Name', 'Menu Name', 'manage_options', 'menu-slug', 'menu_manage_options'); function menu_manage_options(){ ?> <div class="wrap"> ...


1

Since wp 3.4 you could use the Theme Customizer to do this. As far as I know "Static Front Page" is one of the default options of the Theme Customizer. Check the page about the Appearance Customize Screen at codex for a general introduction. And then maybe Customizer tutorials and documentation could be a useful next step.


0

In the end i used this- // Define global variables global $am_globals; $am_globals = array( 'if_autoload' => get_option( 'autoload-or-shortcode' ), ); and this- if( ! $if_autoload = $GLOBALS['am_globals']['if_autoload'] ) {


0

Save yourself a headache and make a class. The static variable can be accessed like a global once it's loaded. Just be sure the class exists before you try to use it! if ( ! class_exists( 'WPSE_20150123_Plugin' ) ) { class WPSE_20150123_Plugin { // our variable that will be set and read back later public static $if_autoload = 'I\'m Not ...


-1

Try This Function checking if $arg / string / exist in mySQL. $arg must be a string / the name of your option / If the function returns true -> option exist; returns false -> there is no option with this name. /** * Check If Option Exist; * @param String * @return boolean; */ function exist_option( $arg ) { global $wpdb; $prefix = ...


0

Use get_option() instead. The get_option() method returns an option for the current blog. In single site installation, the current blog is the only blog. So get get_option() returns the option for it.


0

That little hack just "fixes" the URL when you call the home or siteurl options, image paths are not affected by that. Depending on where you want to show images, you could apply a filter to the_content, search for your URL and add your subfolder to it. Then you could show images in your post content. I don´t know if there is a better, "wider" filter to ...



Top 50 recent answers are included