how to call a function only in specific pages and exclude it from other pages

if you know which page id , for example , you can change your page.php if ( get_the_ID() == ’99’ ) { my_specific_page_99_calls(); } and then on functions.php my_specific_page_99_calls( require_once(GABFIRE_FUNCTIONS_PATH. ‘/review-options.php’); require_once(GABFIRE_FUNCTIONS_PATH . ‘/custom.php’); require_once(GABFIRE_FUNCTIONS_PATH . ‘/shortcodes.php’); require_once(GABFIRE_FUNCTIONS_PATH . ‘/post-types.php’); ) i’m sure there’s other options, but this will get you there. to exclude from … Read more

Missing parent page attribute

Ok, I solved it myself. The Drop-down list is only displayed if there is at least one public page. Why there is not just “There is no public page” text instead of hiding the list without a hint!? I have set every page to private, so that the list was not displayed at all. If … Read more

Add page title as a javacript variable to specific posts

Use a shortcode. In your plugin or theme (functions.php) add: add_action( ‘after_setup_theme’, ‘wpse_42534_add_permalink_shortcode’ ); function wpse_42534_add_permalink_shortcode() { add_shortcode( ‘permalink’, ‘get_permalink’ ); } Now, your users can use the string [permalink] anywhere in the post to print the URI to the current post or page. Oh, and welcome to WordPress Stack Exchange!

Loading Scripts on Specific Pages

I’d suggest moving the script registering into the init action, and moving the enqueue(s) into a callback hooked onto wp_print_scripts. Eg. add_action( ‘init’, ‘register_those_scriptsNstyles’ ); function register_those_scriptsNstyles() { wp_register_script( .. your script params .. ); wp_register_style( .. your style params .. ); ..etc.. } add_action( ‘wp_print_scripts’, ‘enqueue_those_scriptsNstyles’ ); function enqueue_those_scriptsNstyles() { if( !is_page( ‘some-page’ ) … Read more

Hide the Private prefix on one specific page

This worked for me. One of the keys is that you have to make sure to pass the content through unchanged if it doesn’t meet the condition. function title_format($content) { if (is_page(‘members’)) : return ‘%s’; else : return $content; endif; } add_filter(‘private_title_format’, ‘title_format’); add_filter(‘protected_title_format’, ‘title_format’); This will only apply to the page with a slug … Read more