How do you avoid caching during development?

Is there a simple way to prevent all caching when testing the appearance of changes to the site? I use WP Super Cache. I can delete its cache using the option provided, delete the cache for my browser, and still some changes to CSS or widgets do not refresh. I try other work-arounds like switching browsers or computers, but there must be a more stream-lined workflow where I can ensure I'm viewing the changes I made and not some cached …
Category: Web

How to code a wordpress page properly? Dashboard or unique Theme files or alternative?

At the moment I want to do individual pages which will display results fetched from an api (each page has an individual api key) from an external site. Later I want to add a plugin where you can enter the api-key and then creates the individual site. It is my first project like that and I am not completely sure, what is the right way to develop such pages. As far as I understood pages are not stored as files …
Category: Web

Extend Wordpress Core Classes in OOP Theme?

What is the best way of using WordPress's core classes in the context of an object-oriented design? I am trying to use $wp_admin_bar to remove a couple of the default WordPress designs but I am not able to find where to add $wp_admin_bar that does not trigger an error. Below is my code. The comments should help to understand what I have tried, and what my thought process was: <?php defined( 'ABSPATH' ) or die('Nothing to see here'); // Since …
Category: Web

Select parent page and all its child page but exclude one specific child page

Hi everyone hope all is good. I need some suggestion. I need to select parent page and all its child page but exclude one specific child page. can you please tell me how can i exclude specific child ? ```// Store Only Show For the Registered Users function woocommerce_store_private_redirect() { global $post; if ( ! is_user_logged_in() && (is_woocommerce() || is_cart() || is_checkout() || is_product_category() || is_product_tag() || is_product() || is_tree(64) ) ) { // feel free to customize the following …
Category: Web

Keeping WP database synced across multiple developers using git

I'm working on improving my git workflow as it applies to my WordPress development projects. Often, when developing a content management system, I'll create a development server (like http://dev.finalsitename.com) containing the custom post types and taxonomies that will be used in the production version. This allows my client to begin adding their content to the site. While they are working on this task, I'm usually building out the look and feel as well as the custom programming/plugins that will be …
Category: Web

Including code from other themes in child themes

I'm about to build a new site based on a theme close to what I'm looking for. I understand the concepts around child theming & have read the caveats about overriding php or css files like the one described here. Using such workarounds and calls from functions.php, is it possible to build a "Frankenchild theme" by taking chunks of a second (would-be parent) theme and patching them into the child theme? I'm not quite asking about creating a child of …
Category: Web

wp-insert-post execute from server?

I wanted to ask for help. I am working on a project to develop a program to publish a post to many wordpress sites that aren't on a multisite network but are all on the same server. the requirements for this program is that it does not take delay for publishing so the post should be sent once onto the server and the server will have to add the post to many sites and the program also needs to filter …
Category: Web

Create brand-new re-designed site without affecting live site?

I've been teaching myself web development and was given the chance to completely re-design a company website. The site itself is managed on WordPress which I have no experience in. So I would like to use this as a good opportunity to further develop my skills and learn more about CMS in general. The website is fairly oldskool and basic with minimal content and functionality. As far as I'm aware, it also doesn't use a database. So I believe it …
Category: Web

How best to keep my localhost on Http while my Remote production is on Https

I am using a plugin **Really Simple SSL** that configured to use SSL. And I use WP Migrate Pro to move my DB from local to remote. But I usually run into the problem of pulling the DB from productions to localhost during development, most of my links on the localhost are using https. I do not want to set SSL on my local development. Presently, I deactivate the plugin Really Simple SSL using `wp cli'. Next, I have to …
Category: Web

Move first half of posts to one parent page, second half to the other page

there! Let's assume that we have 2 posts (Post A, Post B). They already exist and located like following example.com/post-a Now I want to create 2 separate parent pages like cat1 and cat2. How can I rearrange posts and get something like that: Post A: example.com/cat1/post-a Post B: example.com/cat2/post-b And when I open example.com/cat1 I want to have list of post from cat1.
Category: Web

Creating one user access account for all the multiple sites

I am new to WordPress and ill just state the situation. We have multiple websites created independently and I need to create a single account for the subscribers for all the websites like google. I am asking for advice and help on how to build this and I read multiple forums that WPMU is capable of doing this but it has limits like for example it throws the WordPress wp-admin as a login page maybe I need a custom login …
Category: Web

How can I capture Memberpress user info after signup

I'm currently working on a website where users can purchase subscriptions using memberpress, I want to capture the user data after the signup process is completed and the payment transaction is also completed as well. If I add the member through dashboard manually I'm able to catch the user info as there is no payment gateway is involved, with this code function mepr_capture_new_member_added($event) { $user = $event->get_data(); //mail('myemail', 'mp user added', 'new user added successfully'); } add_action('mepr-event-member-added', 'mepr_capture_new_member_added'); As I'm …
Category: Web

How to deal with internal links in blog while developing new site in WordPress?

I have a client for whom I'm developing a new WP site. Their current site uses DNN but due to security reasons (among others) they have chosen WordPress. As we are migrating and updating blog content there are many internal links pointing to pages in their old site. Their url structure is: https://www.example.com/resources/blog-name/title-of-post However in the new site the structure will be: https://www.example.com/blog-name/title-of-post What is the best way to deal with this? Should we go in the dev server as …
Category: Web

Bedrock WordPress retro-porting to standard WP installation: is this allowed?

I am dealing with something never seen before: a WordPress website where there is not standard directories, and wp-content was moved in /app, all files was moved elsewhere and all seems to work properly, backend/frontend side. It should be done using BedRock, as I see. Please take a look at here: - index.php - app/ --- plugins/ --- uploads/ - wp/ --- wp-admin/ --- wp-snapshots/ --- wp-config.php Screenshot: https://imgur.com/gallery/Bqs4yse Could be this a standard re-packaging structure (i.e using Composer or …
Category: Web

Best practice differences in DB options and wp-config between live, staging and local WordPress environments?

I've been using staging sites for years. So I'm not asking about the necessary difference to setup a working staging site such as search replacing URLs, dev version control branches, changing table prefixes etc. I'm asking for differences which improve security, workflow or quality of life. Differences in options or wp-config.php established upon initial environment creation or when transferring between different environments. Here's some examples I currently establish: blog_public db option - Allow search engine crawlers in live, block search …
Category: Web

I want to share local developement and staging DB — Is this very smart or very stupid?

Basically: I want my work to be meaningful and efficient. I am considering making my local development AND staging database the same thing. I would develop on my local machine but have the SQL data stored on a web server. I could build the site and move the important parts to staging where I can give the client access for writing text when they want to supply their own copy. I could keep building other features and pages while the …
Category: Web

Get Current Menu Location inside Nav_Walker

How can I retrieve the current menu location (as registered with register_nav_menus) from inside a nav-walker class? eg: <?php class Special_Nav_Walker extends Walker_Nav_Menu { // How can I get `special_menu` here, when the walker is applied to the menu (see below) } wp_nav_menu( [ 'theme_location' => 'special_menu', 'walker' => new Special_Nav_Walker(), ] );
Category: Web

Gutenberg Development vs Release version?

I have a question about using Gutenberg Development version vs the release version. I am currently using the development version as it has some features still not available on release that are of particular interest to me (nested blocks), but I'm wondering about the following things: Will it be possible to move to release version from development version without messing up my posts that used the development version of the plugin, once the release version catches up with the same …
Category: Web

About

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