Search the Community
Showing results for tags 'wordpress'.
-
Hey guys. I am Looking for some help here, dunno where else to ask, but im sure someone will know where my problem is. I got this wordpress theme and cant work out whats wrong with the display image. on front end i can set the image as main image heres the php of it <?php ini_set( 'display_errors', 0 ); require( '../../../../wp-load.php' ); if (!is_user_logged_in()) { die(); } $attachmentid = (int)$_GET['id']; if ($attachmentid == 0) { die(); } global $current_user; get_currentuserinfo(); $userid = $current_user->ID; $post = get_post($attachmentid); $photo = $post->post_title; $post_parent = get_post($post->post_parent); $upload_folder = get_post_meta($post_parent->ID, "upload_folder", true); $author_id = $post_parent->post_author; //if the current user is the one who added the post if ($author_id == $userid || current_user_can('level_10')) { update_post_meta($post->post_parent, "main_image_id", $upload_folder."/".$photo); echo _d('Default image has been set',779)."<br />"._d('Refresh the page to see it change',780); } ?> and im not quite sure whats happening here, im a total ROOKIE at php as a matter of fact so yeah... the second part... the loop where its supposed call for the image, i cant really find it in all those files... maybe if somebody explains to me what happens in the last 4 liines i might figure out whats wrong?
-
Hi everyone, here is a thing that I need help with. Firstly I am not good in php programming - have some understanding of it. First: why? I am starting up a site that sells editorial content (images) to different newspapers, magazines and so on. The website will show the images and let the customer choose licens and size of image (large, medium, small) since there are big difference between prices, depending on the size of the image, I need the function to on-demand resize the image after customers choice. So far so good - the site I have works and if I fiddle around with pricegroup and size it does the job of resizing - but and this is a big but, when it resizes the image it also deletes all information in exif, metadata colorprofile and resolution. So the customer gets a image that he cannot print or use at all. The developer of the shoppingcart will not alter the file to solve this issue (atleast not yet) but I am free to do this myself as I see fit. So to clarify: I need to modify the code below to preserve all information (exif, colorprofile, copyright, metadata). Either by using wordpress GD library (it does use that now) or switch it for better usage with imagick. But the original file must be left unaltered so a new copy with the new size is created upon checkout and then made available for download after purchase. Code that does the resizing: public function create_download_size( $size, $location=null ){ $image_p = imagecreatetruecolor( $size['width'], $size['height'] ); $image = imagecreatefromjpeg( $location ); list( $current_image['width'], $current_image['height'] ) = getimagesize( $location ); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $size['width'], $size['height'], $current_image['width'], $current_image['height']); $destination_file = $this->tmp_dir . basename( $location ); if ( ! file_exists( $destination_file ) ){ wp_mkdir_p( dirname( $destination_file ) ); } From what I have been told the function "imagecopyresampled" make a copy of the original and it is then all information is deleted. Can I extract the exif and then rewrite it back to the new resized copy of the image? or rewrite this code to use imagick instead, imagick should preserve exif (do not know but been told so) So do anyone want to give it a try and solve this? I have according to my webhost imagick installed at "exec('/usr/bin/convert') I hope that this is something that can be solved. Regards, mxfarsa..
-
- gd library
- exif
-
(and 3 more)
Tagged with:
-
I am in the process of converting a widget plugin where the user inputs the settings via the widget page to where the user inputs the settings via an admin page. Everything is working fine, apart from the dropdown option. This is the settings field callback with the dropdown: <?php public function socialiconsselect_callback() { printf( '<select id="socialiconsselect" name="social_contact_display_options[socialiconsselect]" />', $options = array('Light', 'Dark', 'Modern Flat', 'Cute', 'Shaded', 'Simple Flat', 'Circle', 'Vintage', 'Retro', 'Retro 2', 'Wooden', 'CSS and HTML5 set 1', 'CSS and HTML5 set 2') foreach ($options as $option) { '<option value="' . $option . '" id="' . $option . '"', $socialiconsselect == $option ? ' selected="socialiconsselect"' : '', '>', $option, '</option>', } '</select>', isset( $this->options['socialiconsselect'] ) ? esc_attr( $this->options['socialiconsselect']) : '' ); } Can anyone see what I have done wrong? Put this through PHPStorm and corrected the syntax errors it stated, which gave me this: public function socialiconsselect_callback() { printf( '<select id="socialiconsselect" name="social_contact_display_options[socialiconsselect]" />', ($options = array('Light', 'Dark', 'Modern Flat', 'Cute', 'Shaded', 'Simple Flat', 'Circle', 'Vintage', 'Retro', 'Retro 2', 'Wooden', 'CSS and HTML5 set 1', 'CSS and HTML5 set 2'))); foreach ($options as $option) { '<option value="' . $option . '" id="' . $option . '"'; $socialiconsselect == $option ? ' selected="socialiconsselect"' : ''; '>'; $option; '</option>'; } '</select>'; isset( $this->options['socialiconsselect'] ) ? esc_attr( $this->options['socialiconsselect']) : '' ; } The page now loads, but still does not show any options in the dropdown..
-
Hi. Does anyone know how to change the Facebook plugin background to white on my football blog - http://www.stretford-end.com/ (in side bar) Many thanks in advance. Andy
-
Hi I am writing this code for a wordpress plugin that gets content from a json file and then decodes them <table border="1"> <tr> <th>Thumbnail</th> <th>Title</th> <th>Excerpt</th> </tr> <?php $url = http://localhost/wordpress/json; $json = file_get_contents($url); $safe_json = str_replace("\n", "\\n", $json); $query = json_decode($json, true); foreach ( $query as $item ) { echo '<tr>'; echo '<td>' . $item['image'] .'</td>'; echo '<td>' . $item['title'] .'</td>'; echo '<td>' . $item['excerpt'] .'</td>'; echo '</tr>'; } ?> Now I need help in paginating the data. Any help will be appreciated.
- 2 replies
-
- json_decode
- file_get_contents
-
(and 2 more)
Tagged with:
-
NEWBIE ALERT. Here comes another newbie question... Most Internet searches I have made regarding my next question indicate many people are trying to learn how to make their WordPress theme look like the rest of their website. They want to make the theme's fonts, etc. match the look and feel of their existing site. I am trying to do just the opposite. I'm using the latest "Attitude" theme by Theme Horse and I like it very much. It is clean and minimalistic--exactly what I am looking for. However, I am developing/running a quiz program in PHP that uses pages that were not generated by WordPress. I would like these pages to have the same "look and feel" as the native WordPress pages. It appears to me that there is rarely, if ever, any such thing as a single "page" in WordPress because all the "pages" are actually generated on-the-fly by a maze of interconnected php files, MySQL databases, and stylesheets. What a complicated thing it is! Are there a few lines of code which I could insert into a header or something like that to make these pages mimic the "look and feel" of their surrounding WordPress pages? If not, maybe I could at least figure out how to use the fonts from the theme to make my PHP pages look like they belong to the rest of the WordPress installation. If I had it my way, I would run my quiz program from within the native WP pages, making this a moot request, but I haven't yet figured out how to do that either. In addition to studying any replies to this question, I also plan to study the recommendations posted by QuickOldCar on 17 October 2013 - 04:42 PM to BorysSokolov regarding the anatomy of a WordPress theme, etc. That's for the bigger answer, but I'll keep this question here too because it is more specifically for the answer I'm looking for. Probably, if I could learn to write my own WP theme, I could figure out how to adapt my non-WordPress pages to behave well in a WP playground and/or make my non-WP content work within the WP framework and display correctly inside WP pages. Thanks.
-
Are you talented programmer that creates WordPress Plugins or creates Facebook Apps / Software? Maybe you have digital product almost ready to go. We work mainly in the IM Niche but have experience with other niches. I have a Digital Publishing Agency and we are looking to Partner / Joint Venture With You. If you are Bad A$$ Coder and lack the knowledge of launching product then we should talk. We have done ClickBank, Self Hosted and forum launches. As Gordon Gekko once said " Money Doesn't Sleep. There is someone out there ready to buy your product. We like to move fast and we are only looking to work with those that are looking to take action. We are only looking to work with a select number of developers and product creators. If you are a coder we have some products in the pipeline ready to be created. We can collaborate and work out a % of the product moving forward. In order to having a successful product launch a lot of pieces need to come together. We can take care of the following: Pre-Launch Strategy Sales Funnel Creation Front end and upsell Copy Product graphics and branding Video Sales Letter Create or ideas for Upsell's /OTO's JV Contest and setup Affiliate Management Back-end Strategy Webinars that convert prospects to buyers Video Training Creation Membership or download page setup Test Traffic to A/B Split Test the funnel List building We are looking to talk to you if: You have created software but dont know how to do a big profitable launch A method that works and the IM community can benefit from Software that is proven to work, none of that push button crap Bad A$$ Programmer that can Code WordPress Plugin or Facebook Apps Private message me with your contact info. Include your skype if you have it. If you cant private then leave your info in the thread.
-
- product launch
- wordpress
-
(and 2 more)
Tagged with:
-
First off, I'm working on a WordPress website. I'm having issue getting the video to play in the FV WordPress Flowplayer: (1) auto play when the page loads (2) Listen for the button click event (purposedly added the comment tag for testing either one) Here's my code: var $j = jQuery.noConflict(); $j(function(){ (1) $j('#post-1823.flowplayer').flowplayer().play(); (2) /*$j('#post-1823.flowplayer').flowplayer({ play: function(){ console.log('IT PLAYS!'); } });*/ }); The error I'm getting for (1) is "Uncaught TypeError: Object[object Object] has no method 'play'" Uncaught TypeError: Object [object Object] has no method 'play' - custom_scripts.js:33 (anonymous function) - custom_scripts.js:33 x.Callbacks.c - jquery.js?ver=1.10.2:3 x.Callbacks.p.fireWith - jquery.js?ver=1.10.2:3 x.extend.ready - jquery.js?ver=1.10.2:3 q I'm thinking that it's not understanding any of the flowplayer api functions. *Ref Link*: http://flowplayer.org/docs/api.html Can someone please assist me with these issues? Thank you, rolu
-
- javascript
- flowplayer
-
(and 2 more)
Tagged with:
-
I'm getting the error: Error code: ERR_TOO_MANY_REDIRECTS after writing this filter hook function into my child theme functions.php. My code is below: function redirect_wp_login() { $request = basename($_SERVER['REQUEST_URI']); if ($request == 'wp-login.php') { wp_redirect(site_url('/login')); exit(); } } add_filter('init', 'redirect_wp_login'); Anything wrong with the code?
-
Hello, I am using this theme on a site build. I would like to replace the static header image with the Slidedeck 2 Pro, image slider. Their code provided for placing into the header is below. <?php echo do_shortcode( '[SlideDeck2 id=XXXX iframe=1]' ); ?> The pertinent part of my theme's header code is as follows: <div id="header-wrapper"> <div id="header"> <div class="container"> <a href="<?php bloginfo('url'); ?>"><?php $logo = (get_option('myproduct_logo') <> '') ? get_option('myproduct_logo') : get_bloginfo('template_directory').'/images/top-bg.jpg'; ?> <img src="<?php echo esc_url($logo); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>" id="logo"/></a> I have also attached the complete header file. header.php Any help on this would be greatly appreciated, as I am a noob, and do not have the knowledge to perform this task. Thank You, Paul
-
Hi All, I'm trying to rename a category name from my url. Here it is: // Register custom post types add_action('init', 'pyre_init'); function pyre_init() { global $data; register_post_type( 'avada_portfolio', array( 'labels' => array( 'name' => 'Portfolio', 'singular_name' => 'Portfolio' ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => $data['portfolio_slug']), 'supports' => array('title', 'editor', 'thumbnail','comments'), 'can_export' => true, ) ); register_taxonomy('portfolio_category', 'avada_portfolio', array('hierarchical' => true, 'label' => 'Categories', 'query_var' => true, 'rewrite' => true)); register_taxonomy('portfolio_skills', 'avada_portfolio', array('hierarchical' => true, 'label' => 'Skills', 'query_var' => true, 'rewrite' => true)); ... Here is what I have at the moment: function custom_portfolio_to_customer_category_url($content) { $current_path = 'portfolio_category'; $new_path = 'customer_category'; $content = str_replace($current_path, $new_path, $content); return $content; } add_filter('term_link', 'custom_portfolio_to_customer_category_url'); I'm using the str_replace() function to rename portfolio_category to customer_category. "It" did replace it but it seems to have wiped out the category and I'm unable to access the portfolio_category post. Can someone please guide me or assist me in what I'm doing wrong here? Thank you, Hal
-
- wordpress
- str_replace
-
(and 2 more)
Tagged with:
-
Hi, I'm running into an issue retrieve data values from a registration submission form. The form is using a POST method Please see code below. More codes above, just a small snippet ... <div id="s2member-pro-paypal-registration-form-email-div" class="s2member-pro-paypal-form-div s2member-pro-paypal-registration-form-div s2member-pro-paypal-form-email-div s2member-pro-paypal-registration-form-email-div"> <label for="s2member-pro-paypal-registration-email" id="s2member-pro-paypal-registration-form-email-label" class="s2member-pro-paypal-form-email-label s2member-pro-paypal-registration-form-email-label"> <span><?php echo _x ("Email Address", "s2member-front", "s2member"); ?> </span><span class="red-asterik">∗</span><br /> </label> <input type="text" aria-required="true" data-expected="email" maxlength="100" autocomplete="off" name="s2member_pro_paypal_registration[email]" id="s2member-pro-paypal-registration-email" class="s2member-pro-paypal-email s2member-pro-paypal-registration-email" value="%%email_value%%" tabindex="40" /> </div> ... <div id="s2member-pro-paypal-registration-form-submit-div" class="s2member-pro-paypal-form-div s2member-pro-paypal-registration-form-div s2member-pro-paypal-form-submit-div s2member-pro-paypal-registration-form-submit-div"> %%hidden_inputs%% <!-- Auto-filled by the s2Member software. Do NOT remove this under any circumstance. --> <input type="submit" name="registration_submit" id="s2member-pro-paypal-registration-submit" class="s2member-pro-paypal-submit s2member-pro-paypal-registration-submit" value="<?php echo esc_attr (_x ("Register", "s2member-front", "s2member")); ?>" tabindex="400" /> </div> <div style="clear:both;"></div> </div> For this example, I have the following: // Store POST data into a variable $email = esc_attr($_POST['s2member_pro_paypal_registration[email]']); // Detect Submission if (!isset($_POST['registration_submit'])){ // Do nothing } else { // Check it var_dump($email); } This seems like it's correct but I wasn't able to retrieve the POST data and var_dump() was returning an empty string. Does anyone know why and should I post up more codes for more assistance? Thank you, Hal
- 4 replies
-
- post
- retrieve post
-
(and 2 more)
Tagged with:
-
Hi, I am trying to customise some php code in a wordpress theme - the developer has left the planet and need to find a solution. This is the current code: <?php if ( $i < 3 ) { echo '<li class="margin_r"><div class="port_tn"><a href="'; echo the_permalink(); echo '" >'; echo the_post_thumbnail( array(40,40, true, "title" => "")); echo '</a> </div></li>'; $i= $i+"1"; } else { echo '<li class="no_margin"><div class="port_tn"><a href="'; echo the_permalink(); echo '" >'; echo the_post_thumbnail( array (40,40, true, "title" => "")); echo '</a> </div></li>'; $i = "0"; } ?> When the thumbnail is clicked it goes to the portfolio page. WHAT I WANT IT TO DO: I want it to open up the featured image of that portfolio post and open a pretty photo lightbox gallery instead. Skipping the single portfolio page. I then change the code to this code: <a href="<?php echo $image[0]; ?>" rel="prettyPhoto[portfolio-gallery]">'; echo the_post_thumbnail( array (40,40, true, "title" => "")); echo '</a> this now does skip the portfolip page and opens the prettyphoto lightbox, but then says it cant find the image or the url is incorrect. Please could you assist in amending the code to make this work the url of the website is: http://www.hayleyclarke.co.za/website/
-
I'm working on a WordPress website. This is in the child's function.php file. I'm just wondering if I need to sanitize when I embed strings within HTML markup. if (is_user_logged_in()) { $user = wp_get_current_user(); $fName = $user -> user_firstname; $lName = $user -> user_lastname; $items .= '<li id="user-name" title="Edit my profile" ><a href="' . site_url('/something') . '">' . $fName . ' ' . $lName . '</a></li>'; $link = '<a href="' . wp_logout_url($redirect) . '" title="' . __('Logout') . '">' . __('Logout') . '</a>'; } Do I need to sanitize $items and $link? If so, would it be this? $items .= '<li id="user-name" title="Edit my profile" >htmlspecialchars(<a href="' . site_url('/something') . '">, ENT_QUOTES)' . $firstName . ' ' . $lastName . '</a></li>'; $link = htmlspecialchars('<a href="' . wp_logout_url($redirect) . '" title="' . __('Logout') . '">' . __('Logout') . '</a>, ENT_QUOTES)'; How about this one? echo '<p>' . __('A message will be sent to your email address.') . '</p>'; to echo '<p>' . htmlspecialchars(__('A message will be sent to your email address.'), ENT_QUOTES) . '</p>'; Thanks for helping.
-
Hi folks, i'm looking for some advice/help if possible? I'm new to PHP, i've ben given a WordPress site to look after, and one of them is using the wp-navi plugin. When I click on the links for previous posts, the url changes, but it's only displaying the most recent posts from the index page and not older posts I've had a look at the support forum for this plug-in, but they don't seem to be very helpful? I've looked at people who have had similar problems, and it seems to be that I need to change the function calls for previous and next, which i've done, but yet the older posts don't seem to show up. I'm no programmer/coder and I really want to learn how to do this, as I think i'm going to need to start using more PHP, but i've looked at all the code via the WordPress editor and everything seems to be okay according to the instructions to get the plugin working, i'm unsure if i've maybe missed something somewhere? Any help would be gratefully appreciated! Thank you, Mary!
-
I have worked so hard to create a WordPress function and I got stuck. I am pretty sure that for some of you it will take 2 second to figure it out. I am familiar with WordPress and I know my way around it but i lack coding skills. Please help me correct this function keeping in mind that I want my banner and logo included and that's what the: <div class="wrap"> and <div class="icon32" id="icon-index"><br></div> is all about. What I am trying to do is the followings: Have a Main menu item in WordPress Dashboard for both Admins and Subscribers to be displayed with the main Menu titled: "For Buyers" then add submenus with the following titles: Marketing Materials - First Time Buyers - Lead Generation - Ad campaigns. Thank you so much, this is a wonderful community . add_action( 'admin_menu', 'register_my_custom_menu_page' ); function register_my_custom_menu_page(){ add_menu_page( "For Buyers", "For Buyers", "manage_options", "for_buyers", "add_buyers_function", '', 61 ); add_submenu_page( "for_buyers", " Marketing Materials", " Marketing Materials", "manage_options", "marketing_materials","add_marketing_materials"); } function add_buyers_function(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php } //marketing materials for buyers wordpress menu function add_marketing_materials(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php }
-
Dear pals, I need to implement the REST service which explain in Simple-rest. I create a file with name xyz.php with code <?php if(isset($_POST['type']) && (isset($_POST['id']))) { $type = $_POST['type']?$_POST['type']:"undefined"; $id = $_POST['id']?$_POST['id']:"undefined"; //echo "val is :".$type." id is ".$id; } else { $type = "table"; $id = 2; } ?> <?php require_once("wp-load.php");?> <?php //get_header(); wp_head(); ?> <?php if($type=="chart" && $id!="undefined") { $kk_chart = get_html_4_chart(intval($id)); echo $kk_chart; } if($type=="table" && $id!="undefined") { $kk_table = get_html_4_table(intval($id)); echo $kk_table; } wp_footer(); ?> in root folder work fine . But i need to make it in a controller method. So I create a folder named "services" in root of WP and create a controller with name "chart" and write code as include_once("../wp-load.php"); wp_head(); wp_footer(); class Controllers_Chart extends RestController { public function get() { //$this->response = array('TestResponse' => 'I am GET response. Variables sent are - ' . http_build_query($this->request['params'])); //$this->responseStatus = 200; $kk_chart = get_html_4_chart(2); return $kk_chart; } } I just include the relevant get() method only . But I got some unexpected error like Warning: include(Translation/Entry.php): failed to open stream: No such file or directory in C:\wamp\www\wp-oscar\services\index.php on line 22 Warning: include(): Failed opening 'Translation/Entry.php' for inclusion (include_path='C:\wamp\www\wp-oscar\services;.;C:\php\pear') in C:\wamp\www\wp-oscar\services\index.php on line 22 alot of warning like this and a Fatal error as Fatal error: Call to a member function set_filenames() on a non-object in C:\wamp\www\wp-oscar\wp-content\plugins\wp-business-intelligence-lite\functions\functions.php on line 174 please advise me a method to call WordPress Business Intelligence intelligence as a REST service . Waiting your reply Thanks, Anes
-
Hello,Friends i have wordpress blog,after i install "google analytics plugins" i have error on my dashboard like this " SSL certificate problem, verify that the CA cert is OK. Retrying with the CA cert bundle from google-api-php-client. after i search solution on net about this i find solution is like this download http://curl.haxx.se/ca/cacert.pem and save it somewhere. update php.ini -- add curl.cainfo = "PATH_TO/cacert.pem" reference link "http://stackoverflow.com/questions/6400300/php-curl-https-causing-exception-ssl-certificate-problem-verify-that-the-ca-cer/19067939#19067939" now,i dont know how to do can anybody help me pleaseee?
-
Dear friends, I am using the XML-RPC Server to implement a simple login authentication as a web service . So I wrote a function in wp-includes\class-wp-xmlrpc-server.php like function web_auth($host, $db, $dbuser, $dbpass, $username, $password) { $dbhandle = mysql_connect($host, $dbuser, $dbpass) or die("Unable to connect to MySQL"); $selected = mysql_select_db($db,$dbhandle) or die("Could not select database"); //$md5_password = md5($password); $md5_password = wp_hash_password($password); $result = mysql_query("SELECT count(*) AS total FROM wp_users WHERE user_login='$username' AND user_pass='$md5_password' AND user_status=0"); $data=mysql_fetch_assoc($result); //echo "SELECT count(*) AS total FROM wp_users WHERE user_login='$username' AND user_pass='$md5_password' AND user_status=0"; //die($data['total']); if($data['total'] == 1) { return true; } return false; } But the password hash mechanism is not make things proper. Please help me to find the exact password in line $md5_password = wp_hash_password($password); Waiting your fast reply Thanks, Anes
-
Dear pals, I am using the tutorial code of "xmlrpc in wordpress" in URL http://wp.tutsplus.com/tutorials/creative-coding/xml-rpc-in-wordpress/ , but it shows result as blank in my local wamp but it work fine on another local pc. I attach the code and preview of the problem. Please check and help me. Code ===== <?php class XMLRPClientWordPress { var $XMLRPCURL = ""; var $UserName = ""; var $PassWord = ""; // constructor public function __construct($xmlrpcurl, $username, $password) { $this->XMLRPCURL = $xmlrpcurl; $this->UserName = $username; $this->PassWord = $password; } function send_request($requestname, $params) { $request = xmlrpc_encode_request($requestname, $params); $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_URL, $this->XMLRPCURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 1); $results = curl_exec($ch); curl_close($ch); return $results; } function create_post($title,$body,$category,$keywords='',$encoding='UTF-8') { $title = htmlentities($title,ENT_NOQUOTES,$encoding); $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding); $content = array( 'title'=>$title, 'description'=>$body, 'mt_allow_comments'=>0, // 1 to allow comments 'mt_allow_pings'=>0, // 1 to allow trackbacks 'post_type'=>'post', 'mt_keywords'=>$keywords, 'categories'=>array($category) ); $params = array(0,$this->UserName,$this->PassWord,$content,true); return $this->send_request('metaWeblog.newPost',$params); } function create_page($title,$body,$encoding='UTF-8') { $title = htmlentities($title,ENT_NOQUOTES,$encoding); $content = array( 'title'=>$title, 'description'=>$body ); $params = array(0,$this->UserName,$this->PassWord,$content,true); return $this->send_request('wp.newPage',$params); } function display_authors() { $params = array(0,$this->UserName,$this->PassWord); return $this->send_request('wp.getAuthors',$params); } function sayHello() { $params = array(); return $this->send_request('demo.sayHello',$params); } } $objXMLRPClientWordPress = new XMLRPClientWordPress("http://localhost/wp_latest/xmlrpc.php" , "admin" , "admin"); echo '<table border="1" cellpadding="10">'; echo '<tr>'; echo '<td>Request Name</td>'; echo '<td>Result</td>'; echo '</tr>'; echo '<tr>'; echo '<td>demo.sayHello</td>'; echo '<td>'.$objXMLRPClientWordPress->sayHello().'</td>'; echo '</tr>'; echo '<tr>'; echo '<td>metaWeblog.newPost</td>'; echo '<td>'.$objXMLRPClientWordPress->create_post('Hello WordPress XML-RPC', 'This is the content of post done via XML-RPC','').'</td>'; echo '</tr>'; echo '<tr>'; echo '<td>wp.newPage</td>'; echo '<td>'.$objXMLRPClientWordPress->create_page('WordPress XML-RPC page', 'This is the content of First Page done via XML-RPC').'</td>'; echo '</tr>'; echo '<tr>'; echo '<td>wp.getAuthors</td>'; echo '<td>'. $objXMLRPClientWordPress->display_authors().'</td>'; echo '</tr>'; echo '</table>'; ?> Preview(Blank) ============ Thanks, Anes
-
Hi everyone, I have the following .HTACCESS which is used for my PHP files. However I want to keep all the following information (see second .HTACCESS) but change the address of my wordpress files from http://www.mysite.com/wordpress to http://www.mysite.com/ If I follow the tutorial and add the following to my .HTACCESS it works... # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /newformat/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule> # END WordPress ... However none of my other rewrites work... any ideas? My original .HTACCESS file is below; RewriteEngine on # defeat robot exploits RewriteCond %{QUERY_STRING} http:// [OR] RewriteCond %{REQUEST_URI} http:// RewriteRule ^(.*)$ - [F] rewritecond %{http_host} ^mysite.com [nc] rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc] # disable directory browsing Options All -Indexes RewriteRule ^furniture(.*).html$ furnituredisplay.php?page=furniture/furniture$1&type=htm [L,NC] RewriteRule ^android(.*).html$ androiddisplay.php?page=android/android$1&type=htm [L,NC] #php_flag register_globals on #php_flag display_errors off Any ideas how to merge? If possible? cheers, Andrew
-
Here is an image of my comment format: http://oi40.tinypic.com/8w07jt.jpg The hyperlink to each individual comment is the date and time with the url in the format of, for example: /nottingham/#comment-184 After going through my comment templates I found that these two functions do the following, get_comments_link : Retrieves the link to the current post comments AND comments_link: Displays the link to the current post comments The problem is I have no idea where to include these functions so it creates a hyperlink to every comment within every comment. Once this link has been created I'd also like to assign a div to it so I can format it to be in the bottom right corner of each comment. My final goal is to manipulate the link so rather than the comment link itself it will automatically work in the facebook.com/sharer.php which I feel I can do myself once I figure out the previous part. Essentially it will be a share on facebook button, but I have found no plugins which do this yet and thought describing it as a hyperlink would be an easier way to explain what I'm trying to do. Elsewhere I've been told the following: but not sure how to implement this... I hope I've made the question clear, please ask if I haven't. Thanks in advance!
-
Having installed the 'filter by comments' plugin which "Adds query vars (comment_count, comment_count_compare, orderby_last_comment, orderby_last_activity) for filtering posts by comments". Then adding- <?php query_posts( 'orderby_last_activity=1&paged=' . $paged); ?> -to the top of my index page, all of my posts are now being displayed exactly how I want them to be. ie whichever is most recently updated comes to the front. However when a tag is clicked, the results page is obviously the archive page, which this plugin doesn't appear to work on, leaving posts being shown in order they were published rather than updated. When the above line of code is applied to the archive.php file, it simply pulls every post from the blog and displays them as if its the index, nothing is filtered but they are displaying correctly. Is there a way I can hack that code to sort just the archive results? Looking through the archive.php file, the only I think I should be looking at is - <?php if (have_posts()) : while (have_posts()) : the_post(); ?> -as it comes directly after the filtering code and directly before the article. I am not a complete novice with php, I'm learning fast, this one is just beyond me. How about the query.php file? I'm terrified of that one but my solution may well be in there. Any sort of response appreciated.
-
Fairly new to PHP and this is my first post on the site. Just wondered if anyone could help with a piece of code I am trying to get working. It sits inside a Wordpress loop and pulls your 10 latest thumbnails except for the most recent one (as I set the current latest post in an extra large header at the top of the page). The code is doing the job but I am having difficulty sizing the thumbnails: <?php query_posts('posts_per_page=10&offset=1'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php echo $the_query->the_post_thumbnail; ?> <?php if ( has_post_thumbnail($post->ID) ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail($post->ID); } ?> I also have this in my functions.php if ( function_exists( 'add_image_size' ) ) { add_image_size( 'posts-thumb', 220, 170 ); } When I replace ($post->ID) at the bottom of the first script with ( 'posts-thumb' ) the code works as it should and the thumbnails are re-sized but I am losing the ID information attached to the image. Is there a way to put the ( 'posts-thumb' ) snippet in without deleting any of the original code? Thanks.
-
renaming HTML to PHP.. after advertising.. bad idea?
werepairitall posted a topic in PHP Coding Help
We have a website with around 1k pages inside it. They all end in .html.. We spent about a year marketing and advertising specific pages of our website all over the net. We are in a process of updating our website, and wish to implement blogs(wordpress) and other useful tools like comments, ratings, etc.. Many of these scripts(widgets) require that the page end in .php in order to make these scripts work. I am trying to keep everything consistent to our advertisement. My question is, is it possible to rename all .HTML files to .PHP and still keep the advertising links? Without having to go to all of our advertising pages and change links..? If so, what would this process be called.. I heard of sync linking and meta refresh, but not sure if this is what we need.