How can I remove the navigation menu from a Page that is not on the menu?

I have an astra template site that I setup on Wordpress and edit with elementor. One of the new pages I added from NextGen Gallery is not being edited with elementor. It is the only page I don't use elementor with. Also, this page is not on my menu. I only show this page from a link on another page. However when this page shows, it has the navigation menu across the top. I don't mind it being there or …
Category: Web

Is it possible to have a global parameter page which allows to configure other plugins in the same place?

I have a wordpress mu installation which brings together several different sites for clients and I would like to provide them with a settings page to manage the settings of other plugins. In short, I would like to have in a global parameter page, the possibility to configure in the same place, some options of the Yoast SEO plugin and the WooCommerce plugin for example. How can I start this? Thanks for your help.
Category: Web

Sort by price wpdb

I have a page on my wordpress to search for tires everything works fine but I would have liked to know how to add an extra column to sort them also by price. They can already be sorted by size and type... But I can't find a solution for the price. Thanks in advance ! Here is the code : <?php $resultLargura = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id WHERE …
Category: Web

How to display specific category on single post page?

How can I display only the specific category when accessing the posts related to that category? For example, I want to show only CSR Events under Categories When accessing posts related to CSR events. Here's the link to CSR post https://www.mi-eq.com/blood-donation-compaign/ Screenshot: https://i.stack.imgur.com/YoTfk.jpg Similarly, when visiting posts related to other categories, only the specific category will be shown.
Category: Web

How can you wrap add_filter with a if is_home() statement?

I have the follow code: if ( !function_exists( 'df_excerpt_more' ) ) { function df_excerpt_more( $more ) { return ' … <a class="more-link" href="' . esc_url( get_permalink( get_the_ID() ) ) . '">' . esc_attr__( 'Read More', 'applique' ) . '<i class="ion-ios-arrow-thin-right"></i></a>'; } add_filter( 'excerpt_more', 'df_excerpt_more' ); } I'd like to add a second line of "add_filter" and execute it only if page is home. So I'm trying this: if ( !function_exists( 'df_excerpt_more' ) ) { function df_excerpt_more( $more ) { return …
Category: Web

Encoding matter - ? instead of € after settings field callback

In my plugin I have som classes to manage settings field. For some reason in one moment the setting field value with special characters like 30€ in textarea or input[type=text] change to be 30?. I got the value like this in my class : add_action( "admin_init", array( $this, "init_options" ), 1 ); //$this is the Class function init_options(){ $this->current_options = get_option( $this->current_options_name ); $this->add_settings(); } And before to add settings fields, the text is correctly encoded. function add_settings(){ ... $a_callback( …
Category: Web

Missing parent page attribute

Suddenly the parent page attribute is missing on the page edit view. I'm using Wordpress 3.9.1 and the newest Avada theme. The parent attribute has worked. Now it is not shown as page attribute. I've updated Wordpress and the theme. It has not helped. I have switched the theme and set Avada back again and it worked for a short time. Now do not again. What can I do? Thanks!
Category: Web

Hide the Private prefix on one specific page

Trying to conditionally hide the "private" prefix in front of the page title on one specific page named 'members' only. I used this code in functions.php to hide the prefix on all pages. function title_format($content) { return '%s'; } add_filter('private_title_format', 'title_format'); add_filter('protected_title_format', 'title_format'); Tried to hook into this with the if is_page ( 'members' ) in various ways, but so far the only result i managed to get is fatal errors.
Category: Web

Custom user role that can only edit specific (non-custom-type) page and all child pages

My site has several static pages and several custom post types. I'm trying to create a custom user role called students and give students access to ONLY certain custom post types and certain specific static pages. I understand how to do this with custom post types by using add_cap() and populating the 'capability_type' and 'map_meta_cap' fields passed to register_post_type for that custom post type. However, I don't understand how to do this for generic pages (which are not custom, but …
Category: Web

Detecting if I'm on a single, non-post, non-homepage page?

I'm trying to see if I am on a single page, this page is defined by: Is not the homepage for sure. Doesn't have any posts for sure. Here's my code: <?php if ( !is_home() && !have_posts() ) : ?> <div class="single-page"> <?php endif; ?> Added to page.php, but it doesn't seem to do anything. I know for a fact that simply adding html code to this file adds it to every single page. What am I missing?
Category: Web

Setting admin submenu appears only when I cliked on a custom link

I'm doing a plugin. In this plugin I have to add a submenu for Settings. Code : public function __construct(){ add_action( 'admin_menu', array( $this, 'add_setting_page' ) ); } public function add_setting_page(){ add_options_page( $this->page_title, PLUGIN_SHORT_TITLE, 'manage_options', $this->menu_slug, array( $this, 'html_page_template' ) ); } With the function add_options_page in the official documentation, it's written : This function takes a capability which will be used to determine whether or not a page is included in the menu. I manage to go to the …
Category: Web

How to load JS and CSS only on specific Pages using is_page()?

I am building my first WP plugin, it should load some JS and CSS files only on specific pages selected through a form available in the plugin Admin area. Once selected in the form, Page Title gets stored in the DB wp_options table, then the data is pulled back out in a variable named $page_selected. To load JS and CSS files only in the pages selected in form, I wanted to use the is_page() function, passing the $page_selected variable as …
Category: Web

Make a single page in WordPress available only for Admin and Subscribers

I'm trying to make a single page only available for administrator and subscribers from the site. I've put the page as private in WordPress admin and tried to allow that only for these two roles using the code above but it is not working properly. Any help will be appreciated. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $private = get_post_custom_values("private"); if (isset($private[0]) && $private == "true") { if ( current_user_can( 'administrator' ) ) { the_title(); …
Category: Web

How to add specific menu on a specific page or pages

I'm looking for help on how to add specific menu on a specific page or pages with no plugin. I know how to add and register a new menu like this: //* Register third navigation menu position function register_additional_menu() { register_nav_menu( 'third-menu' ,__( 'Third Navigation Menu' )); } add_action( 'init', 'register_additional_menu' ); add_action( 'genesis_before_content', 'add_third_nav_genesis' ); function add_third_nav_genesis() { 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>'; } I would like to …
Category: Web

How can I switch pages?

I have website for local restaurant and for menu there are separate pages (ex: salads, soups etc). Right now the second restaurant was opened and it has a separate menu. What I want to do is to create some kind of switch - so user can select what restaurant he wants to see. And he can switch deserts page of restaurant A and restaurant B. How it should be done?
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.