Post to WordPress from another Server via PHP

I finally managed to accomplish the task using XML-RPC as suggested by denis.stoyanov. If xmlrpc is installed on your Server simply use the wpPostXMLRPC function from stackoverflow. But keep in mind that the used xmlrpc_encode_request() is an experimental function you usually would try to avoid.

form built dynamically with php, not submitting

Your form does not contain an ID. You need to replace name=”form1″ with id=”form1″. This is because your javascript says, onclick=”document.getElementById(“form1″).submit();” which returns False, because there is no form with the ID “form1”.

Twentyfifteen style author comment

These are CSS classes for styling… comment-author-admin bypostauthor For (your) example: .commentlist .byuser {background-color: black;} .commentlist li ul.children li.byuser {border-top: 10px solid #e18728;}

How do I correct the code in php? [closed]

You are mixing html and php content. You should write it like this: <?php function thumbImg() { if ( has_post_thumbnail() ) { the_post_thumbnail( array(54,54) ); } else { echo “<img src=”https://wordpress.stackexchange.com/questions/216047/{$data[“featured_img’]}’ alt=””.get_the_title().”” />”; } } ?> This way, you don’t need to open and close again the php tag.

Wierd site output [closed]

This looks like a hack, probably in W3TC. Try disabling all the Plugins one by one, and if it doesn’t go away, try switching to the default theme. If that did not work, install WordPress from scratch, and transfer the database to it. If you prefer another debug mode, I suppose your script gets hooked … Read more

Run JS Code on userlog out

wp_logout is being triggered server side when the user is logging out, but the fact that it is being triggered do not indicate that there is a browser on the other side that actually triggered it. For example a user might log out via Ajax and then the JS code will not be evaluated. In … Read more

Must use Plugin not updating HTML code in head

I have solved my problem by adding $myCode -> change_url(); and add_action(‘wp_head’, array($myCode, ‘print_header_scripts’)); <?php class some_code { function change_url() { $domain_name = $_SERVER[‘SERVER_NAME’]; $country_code = get_country_code(); if ($country_code == “PK”) { header(“location: http://///////////////”); exit(); } else if ($country_code == “AU” && $domain_name !== “au.cacricketbats.com”) { header(“location: https:///////////////////” . parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH)); exit(); } } function … Read more

Adding Additional Variables on Menus Page

Use the checked function. https://codex.wordpress.org/Function_Reference/checked The HTML you want to render should look like this: <input … value=”hide” checked=”checked” />Hide from these locations.</br> <input … value=”show” />Only show to these locations.</br> What you’re getting instead is probably somthing like this: <input … value=”hide” />Hide from these locations.</br> <input … value=”” />Only show to these locations.</br> … Read more