How to run a php file that uses wordpress functions from command line?
WordPress has a command line library called WP-CLI. You can extend it to create your own commands. I would recommend this for any work on the command line.
WordPress has a command line library called WP-CLI. You can extend it to create your own commands. I would recommend this for any work on the command line.
Update #2: Use my first option to get all of the IDs in an array and then loop through those. I keep trying to understand how / what exactly you are trying to achieve (use the same variable to hold an ID and somehow perform an asynchronous operation below the first block of code which … Read more
By using hook remove_action(‘woocommerce_after_shop_loop_item_title’,’woocommerce_template_loop_price’,10); or CSS span.price { display: none !important; } *Tag May be different as per your theme. Thanks, Vee
Based on this question about retrieving WordPress post slug, you could put together a link like the following: <a href=”http://www.example.com/md/<?php global $post; echo $post->post_name; ?>”>link text</a> Whether that goes to a functioning page or not, I don’t know. It seems like you may want to change rewrite rules in the functions but I’m not sure … Read more
I think this will work for you (tried it and it works): date(‘m’, strtotime(‘0 month’)); date(‘d’, strtotime(‘0 day’)); Here is a discussion on the topic.
From what u have written so far it seems menu_categorie is the custom taxonomy. Make sure it is this only. I get a feeling that you have misses “s” from the end of menu_categorie Anyways The argument ‘cat’ => $id you were using is used for default taxonomy i.e category. But in your case you … Read more
In your code, if an email is set and validated (which I suppose should be the normal case), your code will exit at wp_die(), and never reaches the $wpdb->insert. Your $wpdb->insert statement will only ever be reached if an email is not set, or if “validation” is false. You might want to get rid of … Read more
You can simply add those CSS to admin HEAD section, it’s fast and easy solution. function jrl_styles() { ?><style type=”text/css”> #jrl-wrap { width: 700px; padding: 3em; /* … */ } </style><?php } add_action(‘admin_head’, ‘jrl_styles’); Or you can enque your CSS file like this: function load_custom_wp_admin_style() { wp_register_style( ‘custom_wp_admin_css’, get_stylesheet_directory_uri() . ‘/functions/site-options.css’, false, ‘1.0.0’ ); wp_enqueue_style( … Read more
It should work <?php $my_postid = 1772;//This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters(‘the_content’, $content); $content = str_replace(‘]]>’, ‘]]>’, $content); echo $content; ?>
Use php dot notation. Try: $my_templates = get_stylesheet_directory() . ‘/lp/’; $base = array( trailingslashit(get_template_directory()), $my_templates );