Notify Jenkins of new post on WordPress

Take a look at some of WordPress’s Actions & Filters – in particular, you might want something like publish_post: function my_custom_post_action( $post_id, $post ) { // Send out data to your service using something // like wp_remote_request: // https://codex.wordpress.org/Function_Reference/wp_remote_post } add_action( ‘publish_post’, ‘my_custom_post_action’, 10, 2 ); You may need to ensure that the post is … Read more

how to setup content on a static frontpage with css and xhtml

I would set up a new page template (see http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates), create a new page (Pages > New) and set it to use that template, and then set WordPress to use that page as the homepage (Settings > Reading). Then you can fill the custom page template with whatever content you want in between wp_head() and … Read more

Make WordPress cache permanent for some pages until edited

In reality it is very hard to know when a page is affected by an edit. A page contains footer, memus, widgets, shorcodes and meta data which might change “globaly”. Having a general detection which page is affected by any such change is bordering the impossible. Cache expiration in general is just a very hard … Read more

Use htaccess to redirect WordPress to static website in a subfolder

If you want an external redirect from /2016/<anything> to /2016/a/<anything>, then you can do something like the following before the existing WordPress directives (ie. before # BEGIN WordPress) in your /2016/.htaccess file: RewriteCond %{REQUEST_URI} ^/(\d{4})/(.*) RewriteRule !^a/ /%1/a/%2 [R,L] The negated RewriteRule pattern prevents the redirect from occurring when the URl-path already starts with a/ … Read more

Can wordpress run in root of existing php site with no theme on index.php but all other WP posts/pages?

Short Answer No. The Reason If you take a look at the .htaccess file in the root of your WordPress installation, you will notice these few lines generated by WordPress ( If you have pretty permalink enabled ): # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond … Read more

How can I show the actual content of Posts page because the_content() is showing all blog content?

You can use: get_queried_object_id() to get the ID of the static posts Page. Alternatively, you may also use get_option( ‘page_for_posts’ ). $post_id = get_queried_object_id(); //$post_id = get_option( ‘page_for_posts’ ); // you should use the above on the blog page $content = get_the_content( null, false, $post_id ); get_queried_object() to get the full data of the static … Read more