PHP - Moved: Wordpress Php Custom Plugin Basic Php Help
This topic has been moved to PHP Applications.
http://www.phpfreaks.com/forums/index.php?topic=323633.0 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=314030.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=334215.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=322006.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348006.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=306092.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=349156.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=318539.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=352987.0 Hi
I need to add one more function in my wordpress plugin. below is the sample code working for 2nd tier. Now i need a same function for 3rd and 4th tire.
Function explanation
I am A and i refer B and if B made any sale means I (A) will get direct commission for that sale.
If B refer C and if C made any sale means (B) will get direct commission for that sale. And in this sample code me(A) also get commission for that sale as a 2nd tier.
Now C refer D and if D made any sale means © will get direct commission for that sale and (B) will get 2nd tier commission. So here (A) me too should get 3rd tire commission and i need that function.
Please help me.
function wp_aff_award_second_tier_commission($wp_aff_affiliates_db,$sale_amount,$txn_id,$item_id,$buyer_email,$buyer_name='') { global $aff_tx_msg; $clientdate = (date ("Y-m-d")); $clienttime = (date ("H:i:s")); if (get_option('wp_aff_use_2tier') && !empty($wp_aff_affiliates_db->referrer)) { $aff_tx_msg .= '<br />Using tier model'; wp_affiliate_log_debug("Using tier model",true); $award_tier_commission = true; $duration = get_option('wp_aff_2nd_tier_duration'); if(!empty($duration)) { $join_date = $wp_aff_affiliates_db->date; $days_since_joined = round((strtotime(date("Y-m-d")) - strtotime($join_date) ) / (60 * 60 * 24)); if ($days_since_joined > $duration) { $aff_tx_msg .= '<br />Tier commission award duration expried'; wp_affiliate_log_debug("Tier commission award duration expried! No tier commission will be awarded for this sale.",true); $award_tier_commission = false; } } if ($award_tier_commission) { if(!empty($wp_aff_affiliates_db->sec_tier_commissionlevel)){ $second_tier_commission_level = $wp_aff_affiliates_db->sec_tier_commissionlevel; wp_affiliate_log_debug("Using the affiliate specific 2nd tier commission for this referral. 2nd tier commission level: ".$second_tier_commission_level,true); } else{ $second_tier_commission_level = get_option('wp_aff_2nd_tier_commission_level'); wp_affiliate_log_debug("Using global 2nd tier commission for this referral. 2nd tier commission level: ".$second_tier_commission_level,true); } if (get_option('wp_aff_use_fixed_commission')) { $commission_amount = $second_tier_commission_level; } else { $commission_amount = round(($second_tier_commission_level * $sale_amount)/100,2); } $campaign_id = ""; $is_tier_comm = "yes"; global $wpdb; $aff_sales_table = WP_AFF_SALES_TBL_NAME; $updatedb = "INSERT INTO $aff_sales_table (refid,date,time,browser,ipaddress,payment,sale_amount,txn_id,item_id,buyer_email,campaign_id,buyer_name,is_tier_comm) VALUES ('$wp_aff_affiliates_db->referrer','$clientdate','$clienttime','','','$commission_amount','$sale_amount','$txn_id','$item_id','$buyer_email','$campaign_id','$buyer_name','$is_tier_comm')"; $results = $wpdb->query($updatedb); $aff_tx_msg .= '<br />Tier commission awarded to: '.$wp_aff_affiliates_db->referrer.'. Commission amount: '.$commission_amount; wp_affiliate_log_debug('Tier commission awarded to: '.$wp_aff_affiliates_db->referrer.'. Commission amount: '.$commission_amount,true); } } return $aff_tx_msg; } <?php /** * Plugin Name: Esewa * Plugin URI: https://kamalparajuli.com.np * Author Name: Kamal Parajuli * Author URI: https://kamalparajuli.com.np * Description: This plugin allows for local content payment systems. * Version: 0.1.0 * License: 0.1.0 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt * text-domain: pay-esewa */ if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) return; add_action( 'plugins_loaded', 'noob_payment_init', 11 ); function noob_payment_init() { if( class_exists( 'WC_Payment_Gateway' ) ) { class WC_Noob_pay_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = 'noob_payment'; $this->icon = apply_filters( 'woocommerce_noob_icon', plugins_url('/assets/icon.png', __FILE__ ) ); $this->has_fields = true; $this->method_title = __( 'Noob Payment', 'noob-pay-woo'); $this->method_description = __( 'Noob local content payment systems.', 'noob-pay-woo'); $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->instructions = $this->get_option( 'instructions', $this->description ); $this->init_form_fields(); $this->init_settings(); add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); // add_action( 'woocommerce_thank_you_' . $this->id, array( $this, 'thank_you_page' ) ); } public function init_form_fields() { $this->form_fields = apply_filters( 'woo_noob_pay_fields', array( 'enabled' => array( 'title' => __( 'Enable payment', 'noob-pay-woo'), 'type' => 'checkbox', 'label' => __( 'Tick mark means its enabled.', 'noob-pay-woo'), 'default' => 'no' ), 'title' => array( 'title' => __( 'Esewa Payment', 'noob-pay-woo'), 'type' => 'text', 'default' => __( 'Esewa Payment', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Esewa Payment that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'description' => array( 'title' => __( 'Esewa Payment Description', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Please remit your payment to the shop to allow for the delivery to be made', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Esewa Payment that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'instructions' => array( 'title' => __( 'Instructions', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Default instructions', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Instructions that will be added to the thank you page and order email', 'noob-pay-woo') ), // 'enable_for_virtual' => array( // 'title' => __( 'Accept for virtual orders', 'woocommerce' ), // 'label' => __( 'Accept COD if the order is virtual', 'woocommerce' ), // 'type' => 'checkbox', // 'default' => 'yes', // ), )); } public function process_payments( $order_id ) { $order = wc_get_order( $order_id ); $order->update_status( 'on-hold', __( 'Awaiting Noob Payment', 'noob-pay-woo') ); // if ( $order->get_total() > 0 ) { // Mark as on-hold (we're awaiting the cheque). // } else { // $order->payment_complete(); // } // $this->clear_payment_with_api(); $order->reduce_order_stock(); WC()->cart->empty_cart(); return array( 'result' => 'success', 'redirect' => $this->get_return_url( $order ), ); } // public function clear_payment_with_api() { // } public function thank_you_page(){ if( $this->instructions ){ echo wpautop( $this->instructions ); } } } } } add_filter( 'woocommerce_payment_gateways', 'add_to_woo_noob_payment_gateway'); function add_to_woo_noob_payment_gateway( $gateways ) { $gateways[] = 'WC_Noob_pay_Gateway'; return $gateways; }
this is my plugin code. I want to display a QR code below the description so people can scan that qr code and pay. However I cannot understand how to let admin upload his/her Qr code and how to display it on checkout page just like description. Edited July 13 by Barandcode tags added I'm working with a Wordpress plugin that uses that google maps api to map multiple markers depending on search terms and proximity. You can set an option so that, regardless of the default proximity when the page loads, ALL markers will first appear. In order to help with performance, the authors decided to limit that option to 250 markers. I need to lift that limit to 5,000 (though I currently only have about 500, I don't want to deal with limits as my markers grow).
Based on a comment made in one of the php files it appears the authors enforce the limit in the query itself so I'm pasting the code for the php file that performs the query. Please let me know if there is something else I should do, if this forum is the wrong place or if I should be posting on pastebin and linking rather than dumping the entire file between code tags. Thanks in advance!
<?php if ( !class_exists( 'SM_XML_Search' ) ){ class SM_XML_Search{ // Register hook to perform the search function sm_xml_search() { add_action( 'template_redirect', array( &$this, 'init_search' ) ); } // Inits the search process. Collects default options, search options, and queries DB function init_search() { if ( isset( $_GET['sm-xml-search'] ) ) { global $wpdb, $simple_map; remove_filter( 'the_title', 'at_title_check' ); $defaults = array( 'lat' => false, 'lng' => false, 'radius' => false, 'namequery' => false, 'query_type' => 'distance', 'address' => false, 'city' => false, 'state' => false, 'zip' => false, 'onlyzip' => false, 'country' => false, 'limit' => false, 'pid' => 0, ); $input = array_filter( array_intersect_key( $_GET, $defaults ) ) + $defaults; $smtaxes = array(); if ( $taxonomies = get_object_taxonomies( 'sm-location' ) ) { foreach ( $taxonomies as $key => $tax ) { $phpsafe = str_replace( '-', '_', $tax ); $_GET += array( $phpsafe => '' ); $smtaxes[$tax] = $_GET[$phpsafe]; } } // Define my empty strings $distance_select = $distance_having = $distance_order = ''; // We're going to do a hard limit to 500 for now. if ( !$input['limit'] || $input['limit'] > 500 ) $limit = "LIMIT 500"; else $limit = 'LIMIT ' . absint( $input['limit'] ); $limit = apply_filters( 'sm-xml-search-limit', $limit ); // Locations within specific distance or just get them all? $distance_select = $wpdb->prepare( "( 3959 * ACOS( COS( RADIANS(%s) ) * COS( RADIANS( lat_tbl.meta_value ) ) * COS( RADIANS( lng_tbl.meta_value ) - RADIANS(%s) ) + SIN( RADIANS(%s) ) * SIN( RADIANS( lat_tbl.meta_value ) ) ) ) AS distance", $input['lat'], $input['lng'], $input['lat'] ) . ', '; $distance_order = 'distance, '; if ( $input['radius'] ) { $input['radius'] = ( $input['radius'] < 1 ) ? 1 : $input['radius']; $distance_having = $wpdb->prepare( "HAVING distance < %d", $input['radius'] ); } $i = 1; $taxonomy_join = ''; foreach ( array_filter( $smtaxes ) as $taxonomy => $tax_value ) { $term_ids = explode( ',', $tax_value ); if ( $term_ids[0] == 'OR' ) { unset( $term_ids[0] ); if ( empty( $term_ids ) ) { continue; } $search_values = array( "IN (" . vsprintf( '%d' . str_repeat( ',%d', count( $term_ids ) - 1 ), $term_ids ) . ")" ); } else { $search_values = array(); foreach ( $term_ids as $term_id ) { $search_values[] = sprintf( '= %d', $term_id ); } } foreach ( $search_values as $search_value ) { $taxonomy_join .= " INNER JOIN $wpdb->term_relationships AS term_rel_$i ON posts.ID = term_rel_$i.object_id INNER JOIN $wpdb->term_taxonomy AS tax_$i ON term_rel_$i.term_taxonomy_id = tax_$i.term_taxonomy_id AND tax_$i.taxonomy = '$taxonomy' AND tax_$i.term_id $search_value "; $i++; } } $sql = "SELECT lat_tbl.meta_value AS lat, lng_tbl.meta_value AS lng, $distance_select posts.ID, posts.post_content, posts.post_title FROM $wpdb->posts AS posts INNER JOIN $wpdb->postmeta lat_tbl ON lat_tbl.post_id = posts.ID AND lat_tbl.meta_key = 'location_lat' INNER JOIN $wpdb->postmeta lng_tbl ON lng_tbl.post_id = posts.ID AND lng_tbl.meta_key = 'location_lng' $taxonomy_join WHERE posts.post_type = 'sm-location' AND posts.post_status = 'publish' GROUP BY posts.ID $distance_having ORDER BY " . apply_filters( 'sm-location-sort-order', $distance_order . ' posts.post_name ASC', $input ) . " " . $limit; $sql = apply_filters( 'sm-xml-search-locations-sql', $sql ); // TODO: Consider using this to generate the marker node attributes in print_xml(). $location_field_map = array( 'location_address' => 'address', 'location_address2' => 'address2', 'location_city' => 'city', 'location_state' => 'state', 'location_zip' => 'zip', 'location_country' => 'country', 'location_phone' => 'phone', 'location_fax' => 'fax', 'location_email' => 'email', 'location_url' => 'url', 'location_special' => 'special', ); $options = $simple_map->get_options(); $show_permalink = !empty( $options['enable_permalinks'] ); if ( $locations = $wpdb->get_results( $sql ) ) { // Start looping through all locations i found in the radius foreach ( $locations as $key => $value ) { // Add postmeta data to location $custom_fields = get_post_custom( $value->ID ); foreach ( $location_field_map as $key => $field ) { if ( isset( $custom_fields[$key][0] ) ) { $value->$field = $custom_fields[$key][0]; } else { $value->$field = ''; } } $value->postid = $value->ID; $value->name = apply_filters( 'the_title', $value->post_title ); $the_content = trim( $value->post_content ); if ( !empty( $the_content ) ) { $the_content = apply_filters( 'the_content', $the_content ); } $value->description = $the_content; $value->permalink = ''; if ( $show_permalink ) { $value->permalink = get_permalink( $value->ID ); $value->permalink = apply_filters( 'the_permalink', $value->permalink ); } // List all terms for all taxonomies for this post $value->taxes = array(); foreach ( $smtaxes as $taxonomy => $tax_value ) { $phpsafe_tax = str_replace( '-', '_', $taxonomy ); $local_tax_names = ''; // Get all taxes for this post if ( $local_taxes = wp_get_object_terms( $value->ID, $taxonomy, array( 'fields' => 'names' ) ) ) { $local_tax_names = implode( ', ', $local_taxes ); } $value->taxes[$phpsafe_tax] = $local_tax_names; } } } else { // Print empty XML $locations = array(); } $locations = apply_filters( 'sm-xml-search-locations', $locations ); $this->print_json( $locations, $smtaxes ); } } // Prints the JSON output function print_json( $dataset, $smtaxes ) { header( 'Status: 200 OK', false, 200 ); header( 'Content-type: application/json' ); do_action( 'sm-xml-search-headers' ); do_action( 'sm-print-json', $dataset, $smtaxes ); echo json_encode( $dataset ); die(); } } } So I would like it as a custom script or as a wordpress plugin. The features a I would like to build a social network. The main to features I’m interested in: 1. Member can join only by invitation. The person that invites another person must write a review about the invited person, add a photo, what he does, share the name and contact: email, phone, city, connected to ( until here all these is mandatory in order for the person to join the network ) and website link ( optional ). Only then the person that is invited will receive an email with a link from where to register his account. ( this only for members that will have the right to invite others. For the other type only the admin has the right to make it from just a member, a member with invitation rights. In this case the member will receive an email with a link registration ). The review of a member can be edited only the member who introduced that person in the network ( and the admin ). In case of any edit there will be a notification for the admin with the original version and the new version. The admin of the site has to allow the modification in order for the review to change. 2. The person that is already in the network can invite a number of … ( this will be fixed and determined by the admin. However the admin can raise the number of invitation for a particular member at his will ). This applies for the 2 types of invitations. There will be 2 types of invitations: to join the network and have the right to invite others OR only member ( no right to invite others ). When a person registers to the network, the one who invited him will have one less invitation for the type of member he introduced ( member with invitation rights or member ). If a member wants to invite more people than his invitation are, then it can purchase invitations ( both types ) for different prices ( example: 1 invitations 10$, 2 invitations – 40$ - value determined by the admin ). So a payment integration is needed ( Paypal ). The exception for all this: if a visitor wants to join the network without any invitation he can only pay his way in. However this option will be displayed on the public pages. After payment confirmation the visitor can be redirected to the register page. Admin will make the account active. A sign “paying member” will be shown on this member profile page. After a member is registered and logs in to his account will have the right to: - Add more photos - Add more website links - Add more details at his contact information - Change his unique number. - Have the option to add members ( both types ) - Add updates to his wall. - Search and contact other members via email. So once you log in to the account there is no restriction ( within the network ) or no difference from what you can do on other social sites. Search: First the search will be done in the reviews and after that on the post that members made. The search results will be displayed in the same order ( the words from the reviews will have priority and after that will be displayed the content from posts – that will be arranged in chronologic order – last one will be the first ). But a member can filter those results – review only or posts only. Sponsored bids will be displayed first. The handshake section: Here you will be notified if one of your “looking for” or “offering” announces has expired. When expired the announcement can’t be find on searches or on your profile page. The notification will be active for 7 days. By active I mean: if you click the notification it will take you to the announcement and there you will have an option – make active ( so that other can find the announcement in their searches or in your profile ) another 30 days. The Admin section: The site will be default “no robots” ( not indexed by search engines ). However an option should be in the admin to switch from off “no robots”. This option will apply only for the internal part – profile pages. The pages and link on the first page ( what is public ) can be indexed by search engines. A simple editor from where you can create pages ( something like the section pages in Wordpress ). Any page you create will appear on the first page. After a period of time a member with invitation rights will receive invitation. Example: after one year you will have an extra one invitation for both types of member. What is needed in the admin: a section from where you can modify this time ( time should be in months and the admin will enter the number – example if he puts 1 – that means after 1 month will receive invitation. There should be 2 sections: one time for members that can invite, and one for members only ). A section where you can limit the number of entries for “looking for” and “offering” The section from where you can edit the html code. An option to send newsletters. You will receive and email if another person contacted you via internal email section. Option to delete members. I wanted to develop a Wordpress plugin. There's a few existing plugins for the subject I wanted to code. I thought I would get some inspiration by looking at the code. It's a gigantic mess of spaghetti! The code I looked at, looks like it's been made using an IDE. There seems to be so many folders and files - it's crazy. Others I looked at seem to be similar. It seems like an enterprise application. I'm more than capable of writing a spec and coding myself. The only thing I'm missing would be Wordpress practices - setting up tables and using hooks and other things. Any advice? Or do I just get dirty and sink my head into the code and untangle? QUESTIONS: - Do you use an IDE to code PHP? - What are the most popular IDE's? Thanks. dear folks
this question is regarding the plugin update, file uploader and SFTP - on a wordpress that runs on secured- server
I think I know the answer to the following question as "not possible" but I figured I would check. my sites are on servers where we disable FTP access and only use SFTP access, and also on a different port (not port 22). what if i want to use a automated maintaining service like the following https://mainwp.com http://wwww.infinitewp.com automated Installing and updating plugins to the sites does not seem to work and I assume this is the reason why. I'm also assuming the File uploader extension will not work either. Can anyone confirm this for sure though? Any ideas as far as workaround? one might think of the following way: Can you try adding your SFTP settings into the wp-config of one of my sites to see if that allows the functions to work? we can see an example in http://codex.wordpre...g_wp-config.php under WordPress Upgrade Constants or possibly try this plugin SSH SFTP Updater Support do you have any idear!? cf: https://mainwp.com/f...&highlight=sftp Hi, I have built a custom php program for a client which takes information submitted in a html form and calculates a persons bmi.
I have tested and it works fine, this is in one page (one file).
My problem is I have tried to insert it in to wordpress using both shortcodes and php tag plugins
(you can't insert php in to posts and pages as standard on wordpress)
and I can't get it to work.
The closest I've got is using a php tag plugin that uses shortcodes to replace <?php & ?> but when I submit, it just reloads the page and form rather than showing the result.
as I've said it works fine outside of wordpress. :-\
<h1>BMI Calculator</h1> <!--bmi form--> <?php if (!isset($_POST['submit'])){ ?> <form action="<?php echo $_SERVER['PHP_SHELF']; ?> "method="post"> <input name="weight" size="3"> Enter your weight in kilograms (KG). </br> </br> <input name="height" size="3"> Enter your height in metres, for example if you're 160cm tall you would type in "1.60". </br> </br> <input type="submit" name="submit" value="Calculate"> </form> <?php } else { $weight = $_POST ['weight']; $height = $_POST ['height']; $bmi_catagory = array("Underweight", "Normal", "Overweight", "Obese"); $bmi = ($weight/$height)/$height; if ($bmi <= 18.5) { echo '<h2>Your bmi is '.round($bmi).'</h2><p>You are '.$bmi_catagory[0] .' Click <a href=\'../bmichecker.php\'>HERE</a> to see how Hypnoslimtize can help you achieve a healthy weight.</p>'; } elseif (($bmi > 18.5) && ($bmi <=24.9)) { echo '<h2>Your bmi is '.round($bmi).'</h2><p>You are '.$bmi_catagory[1] .' Click <a href=\'../bmichecker.php\'>HERE</a> to see how Hypnoslimtize can help you stay healthy and avoid temptations.</p>'; } elseif (($bmi >= 25) && ($bmi <=29.9)) { echo '<h2>Your bmi is '.round($bmi).'</h2><p> You are '.$bmi_catagory[2] .' Click <a href=\'../bmichecker.php\'>HERE<a/> to see how Hypnoslimtize can Help you achieve a healthy body weight.</p>'; } elseif ($bmi >= 30) { echo '<h2>Your bmi is '.round($bmi).'</h2><p> You are '.$bmi_catagory[3] .' Click <a href=\'../bmichecker.php\'>HERE</a> to see how Hypnoslimtize can help you achieve a healthy body weight.</p>'; } else { echo 'Your bmi is '.round($bmi); } } ?> <!--bmi form end--> Hi all, I've been struggling to get an if statement to work. I'm new to PHP so bear with me! I have an events listing page where I pull a value from a custom field to display a 'buy tickets' button. I can get the button to display and it works well but what I need to do is customise the code so if there is no ID present, then a piece of text displays. Any pointers appreciated. This is one method Im using for custom fields which works well - the if statement works here also. Code: [Select] <div> <p><strong>Location:</strong> <?php $event_location = get_post_meta($post->ID, 'Event_Location', true); if ($event_location) { ?> <?php echo $event_location; ?> <?php } else { ?> <p>No Location Available.</p> <?php } ?> </p> </div> This code pulls in the buy tickets button but I cant figure out how to create an if statement with it! grrrr... Code: [Select] <div> <p> <?php $values = get_post_custom_values('Product_ID'); echo get_button_code_for_product($values[0]); ?> </p> </div> I would like it to look for the ID and if it can't find it then displays ' No Product ID' or some such text. Hey guys,
Wordpress has the ability to recognize a custom page and make it available to select it and use when you are logged in in the pages section of the admin ui. To make it work you add this:
<?php /* * Template Name: My Custom Page * Description: A Page Template with a darker design. */ // Code to display Page goes here...My question is how does wordpress scan and find these files and then show them in a drop down menu on the pages tab of the admin? Is it done with regular expressions? Many thanks for any help! Hope someone here can help me. Ive been commissioned to convert a template to wordpress that includes a portfolio... I built a portfolio page from a custom post type. that works. Items are categorized with a custom taxonomy named port_cats. that works also On the portfolio page, there is tabbed content built with jquery to show and hide items by category. So theres a category nav menu, plus each item wrapped in classes to show and hide. Im stuck on plugging this in correctly, and am SO CLOSE. I have the category nav list working, but having trouble getting worpress to read the correct category slug inside the loop. Heres how the jquery needs to work: for the menu: Code: [Select] <li><a href="#" rel="category-slug">Category Name</a></li> to hide and show the items: Code: [Select] <ul> <li class="category-slug"> title/thumb/content </li> </ul> Heres my code: Code: [Select] <ul class="select"> <?php //list custom portfolio categories $taxonomy = 'port_cats'; // define portfolio categories from taxonomies in functions.php $tax_terms = get_terms($taxonomy); foreach ($tax_terms as $tax_term) { echo '<li><a href="#" rel="' . $tax_term->slug . '">' . $tax_term->name.'</a></li>'; } ?> </ul> <ul class="display"> <?php // ADD PORTFOLIO $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 6)); while ( $loop->have_posts() ) : $loop->the_post(); $custom = get_post_custom($post->ID); $screenshot_url = $custom["screenshot_url"][0]; $website_url = $custom["website_url"][0]; ?> <li class="<?php echo $tax_term->slug; ?> "> <a href="<?=$website_url?>"><?php the_post_thumbnail(); ?></a> <?php the_title(); ?> <?php the_content(); ?> <a href="<?=$website_url?>Learn more</a> </li> <?php endwhile; ?> </ul> Whats happening is that worpdress is repeating the last category slug on every display item... can anyone tell me what i have wrong here??? THANK YOU! Trisha I am developed a custom PHP page with filters, addto cart module, music playlist everything. How can i implement it into WordPress? I am a newbie, any help thanks. My custom PHP work directory structure : location : public_html/my_work website URL : website.com/my_work Everything working good, but my wordpress heaer and footer missing, thats what i am asking to how to implement my custom development multiple PHP page work into Wordpress. This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=327155.0 |