Help Code Review – I need to write on .htaccess file from theme’s function.php

The code below has work for me in the past 🙂 function add_to_htaccess( $rules ) { $content = <<<EOD # Enable Vary: Accept-Encoding Start <IfModule mod_headers.c> <FilesMatch “\.(js|css|xml|gz)$”> Header append Vary: Accept-Encoding </FilesMatch> </IfModule> EOD; return $content . $rules; } add_filter(‘mod_rewrite_rules’, ‘add_to_htaccess’);

How to get short description under heading – Visual Composer [closed]

I got resolution, vc_map( array( “name” => __( “xxxxxx” ), “base” => “xxxxx”, “icon” => plugins_url(‘img/vc-icon.png’, __FILE__), ‘description’ => __( ‘xxxxxxxx’, ‘xxxxxxxxxx’ ), “params” => array( array( ‘type’ => ‘dropdown’, ‘heading’ => __( ‘Select xxxxxx’, ‘xxxxxxxxxx’ ), ‘param_name’ => ‘id’, ‘admin_label’ => true, ‘value’ => $xxxxcvx ), ), ) ); I implemented ‘admin_label’ => true, … Read more

How do I locate specific part of code that affects ssl?

The gif is being loaded by your infinite-scroll plugin. The gif itself is in the uploads folder, which isn’t where it would be if it came with the plugin. This suggests that the plugin has settings where you can choose your own loading gif. Find the plugin settings and there should be a setting for … Read more

How can I call functions from a custom plugin?

You don’t, alert is a javascript function that runs in the browser. PHP runs on the server, the two are different languages that run in different places. Instead, consider using script tags: return ‘<script>window.alert(“Connected to the database successfully.”)</script>’;` console.log(“”) may be a more appropriate method than alert(“”) for debugging I would also note, that shortcodes … Read more

Add_Meta_box to custom page (formidable edit post)

Like this? <?php /* Plugin Name: Your plugin name Plugin URI: http://www.domain.com Description: Description Author: You obviously Version: 1.0 */ /** * Adds a meta box to the post editing screen */ include(‘meta_box/meta_box.php’); ?> meta_box.php <?php $post_id = $_GET[‘post’] ? $_GET[‘post’] : $_POST[‘post_ID’] ; $page_temp = get_page_template_slug( $post_id ); if ($page_temp == ‘template_name.php’) { function … Read more

Pause form submissions while upgrading plugins

There are a couple of ways to check if wordpress is actively running the core upgrade process. First, you could check the WP_INSTALLING constant, or use the wp_installing() function. WordPress will also utilize a .maintenance or maintenance.php file if you’d like to present any custom messages to users while the upgrade process is happening. Here … Read more

Multiple Meta key in search

You will need to switch between using query_posts (not recommended), to using WP_Query. Using WP Query is similar to query_posts, you will pass an array of arguments, and include the meta_query args. Something like: $args = array( ‘posts_per_page’ => 1, ‘no_found_rows’ => true, ‘post_type’ => ‘rrf-result’, ‘rrf_result_year’ => wp_unslash( ( string ) $_POST[‘result_year’] ), ‘meta_query’ … Read more