11

New workflow, since the Admin SSL plugin is not supported. use the Plugin WP https See the settings If you want SSL for wp-admin, add this to the wp-config.php: define( 'FORCE_SSL_ADMIN', TRUE ); If you want also SSL for the log in page, add this to the wp-config.php define( 'FORCE_SSL_LOGIN', TRUE ); Add the follow line to the .htaccess; remove the ...


5

If $page_selected returns a string containing the page title, it should work fine. I have tested it and is_page() accepts page title, page ID and the slug. If you are facing issues, it will be better to store page ID in the database and use it with is_page() Please refer to https://codex.wordpress.org/Function_Reference/is_page for more details on the ...


4

WordPress already has a built-in Page Template hierarchy to handle this exact situation. You don't need to mangle your page.php code or add a filter, just follow the naming conventions for the hierarchy: custom template file : The Page Template assigned to the Page. See get_page_templates(). page-{slug}.php - If the page slug is recent-news, WordPress will ...


4

If a page won't work without a specific template, I would just remove the need for them to select a template. Filter template_include and select the template based on the requested page: function wpse50455_template_include( $template ) { // check if it's a page if ( is_page() ): $this_page_id = get_query_var( 'page_id' ); // check ...


4

Use Query Monitor Plugin. This will tell you how many Queries along with the time taken by each, at what place it was called along with stack trace. It will even tell you time taken for page generation. As others told, the number of queries is not the right parameter, but having anything over 100 would not be a good indicator in general. The Plugin is ...


4

This is all depends on what queries do you run on a page, are you using simple or complicated queries etc. There are really no set minimum or maximum amount of queries to a page. You will need to look in context of your site specifically and weigh the amount of queries to what is actually happening on your page. Wordpress can be quite harsh on resources ...


3

I make some pretty change and I hope this help you well. Try below code: function my_custom_tooltip() { wp_enqueue_style( 'custom_tooltip_frontend_css', plugins_url('custom-image-tooltip/custom-image-tooltip.css') ); wp_enqueue_script( 'custom_tooltip_frontend_js', plugins_url('custom-image-tooltip/custom-image-tooltip.js'), array('jquery'), '', true ); ...


2

If you do this with pages, you will either have to make two pages, or you can put it in the same page and only show the content of restaurant B when you click a button or link (for instance). This can be done with jQuery, for example. In the latter case you will have the same URL for the page. There are many ways to go at this. You could also make parent ...


2

There's no way in WordPress to assign the capability for editing (or any action) a specific post to a role. However, you can filter capabilities checks and change them on the fly using the map_meta_cap. When handling post permissions, WordPress ultimately deals in just 4 capabilties: edit_post read_post delete_post publish_post Then whenever an action is ...


2

The is_home() function isn't available until the parse_query action. So you'd probably want to rewrite your code like so: if ( ! function_exists( 'df_excerpt_more' ) ) { function df_excerpt_more( $more ) { return ' &hellip; <a class="more-link" href="' . esc_url( get_permalink( get_the_ID() ) ) . '">' . esc_attr__( 'Read More', '...


1

please try this if ( have_posts() ) : while ( have_posts() ) : the_post(); if ( get_post_status (get_the_id()) == 'private' ) { if ( current_user_can( 'administrator' ) ) { the_title(); the_content(); } else if ( current_user_can( 'subscriber' ) ) { the_title(); the_content(); } else { echo 'this ...


1

try working with a conditional statement: function add_third_nav_genesis() { if( is_page( array( 6, 7, 8 ) ) ) { echo'<div class="osastot-valikko">'; wp_nav_menu( array( 'theme_location' => 'third-menu', 'container_class' => 'genesis-nav-menu js-superfish sf-js-enabled sf-arrows' ) ); echo'</div>'; } } ...


1

Pages can have a specific template, so just create a new template and add the Menu on it. You can copy the code on pages.php(this is the default page template) of you theme and paste on a new file (like "template-page-with-menu.php"). On the top of the code you must add the Template Name: <?php /* Template Name: Page with Menu */ ?> Then select ...


1

There are many ways to achieve this, ranging from simple to complicated. A simple one may suffice in your case. Simply generate three different menus in the backend and display them depending on the page where you are: if (is_home) wp_nav_menu (array('menu' => 'home')) elseif (is_page (array('menu-a,deserts-a'))) wp_nav_menu (array('menu' => '...


1

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'...


1

You need to add a Custom Post Type with slug giveaways and create posts under that Post Type. It will give you url like example.com/giveaways/post-name as required.


1

Wordpress uses a lot of plugins and is very query heavy but the in spite of that, the front page uses 59 queries to generate itself. I think the default (on a vanilla WordPress install on the default theme) is 27 or something of that nature. The larger the number of queries, the slower the page is going to load and the more load you are going to put on your ...


1

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 I have made a page ​​public, I could select it as a page attribute of a new ...


1

You can add this to your body tag of your current theme <body <?php body_class('class-name'); ?>> and then specifically target the container. body.post-id #yourdiv { border: 2px solid red; } Always work for me.


1

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 ...


1

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 ...


1

Sure, if you want it by ID (which might or might not be good idea, depending on how likely ID will stay same for a long time - no migrations, etc) that would be something like: if( !is_page(135) ) { // code goes here } See Conditional Tags > Page in Codex for more. Alternative way would be to do this in some filter, as opposed to editing template ...


1

I had multiple problems with your solutions (but it helped me). I'll put my solutions here for the following case : Wordpress multisite Server on vestacp running on apache with nginx proxy .First i only used this WP extension : "SSL Insecure Content Fixer" who can handle WPMU, and the "mixed content" error (Since "Wordpress Https" is deprecated and not ...


1

Try the Better WP Security Plugin. Along with a bunch of helpful tweaks to secure your site, it has some settings that allow you to force ssl to the login page, or the entire back-end if you choose, and to selected pages on the front end per content via a selection box added to the visual editor. Very easy to use. Of course, you do have to have SSL set-...


Only top voted, non community-wiki answers of a minimum length are eligible