Trying to increase WP Memory Limit

Try adding to wp-includes/default-constants.php You’ll probably see the default values of 40M starting around line #20, change these values. My setup is as follows: // set memory limits if ( !defined(‘WP_MEMORY_LIMIT’) ) { if ( is_multisite() ) { define(‘WP_MEMORY_LIMIT’, ‘256M’); } else { define(‘WP_MEMORY_LIMIT’, ‘256M’); } }

tag is ignored when using xml-rpc

When you add content to the post_content, WordPress wraps its own tags around everything and removes certain tags (such as script tags). Plugins, such as Visual composer let you add raw JS, ie. your script tags. However, if you don’t want to use a plugin, you can add it directly into your page.php or footer.php … Read more

Merging two excerpt functions to work with conditions

Depending on where in the loop you call excerpt() wpautop might be creating the <p>…</p> wrapper. In that case, you could wrap $excerpt with <p>…</p> before returning it. Edit: Try this approach <?php echo excerpt(25).”\n”;?> (or possibly “\n\n”) to change the behavior. in function awesome_excerpt() you have $text = substr( $content, 0, strpos( $content, ‘</p>’ … Read more

Password Protection for posts and pages [duplicate]

I’ve used the following to protect individual pages: First add a field to the Publish Metabox: add_action( ‘post_submitbox_misc_actions’, ‘my_post_submitbox_misc_actions1’ ); function my_post_submitbox_misc_actions1(){ echo ‘<div class=”misc-pub-section my-options”> <input type=”checkbox” id=”fgpsn_protected_content” name=”fgpsn_protected_content” value=”true”‘; if ( get_post_meta(get_the_ID(), ‘fgpsn_protected_content’, true) == ‘true’ ){ echo ‘ checked’; } echo ‘> <label for=”fgpsn_protected_content”>FGPSN Content</label></div>’; } Then save the meta data – … Read more

How to create a custom post while submitting the form

Which plugin you’re using for the contact form? It looks likeyou’re thinking about Gravity forms. You can create it with a custom function when the action gform_after_submission is fired – https://www.gravityhelp.com/documentation/article/gform_after_submission/ For Contact form 7, there is another hook, see here: wpcf7_before_send_mail, wpcf7_mail_sent http://hookr.io/plugins/contact-form-7/4.3/ Ninjaforms…http://hookr.io/plugins/ninja-forms/2.9.28/#index=a for the other plugins you should have a look yourself. … Read more