Jump to content

Search the Community

Showing results for tags 'wordpress'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hi, I'm Drew. I'm a web developer, primarily on the WordPress platform. I'm not a proficient PHP programmer but I can and have edited lots of PHP code to improve my sites. So, in a way, I'm learning PHP...the hard way. As probably is the case with most users, I'm here becuase I'd like help with some code and because I want to fasttrack my PHP education. I'll get to that eventually, this is just me introducing myself to the community. Best regards.
  2. Could someone please help me out here? I've been using the code below in some of my WordPress pages, but I've looked at it so long ago that I honestly can't remember how to debug it - go figure... The only thing that changed was the database. It works like this: URL has parameter called id in this form: http://example.com/post?id=... Code checks if param is present, otherwise it redirects home. If the param is present, code gets the ID and compares it to the records in the MySQL database hosted by my ISP. Match gets used in an echo statement. A div on the page is activated. Database Layout: +-------+------------+------------+------------+------------+---------------+ | id | Naam | Metgesel | Kind1 | Kind2 | Email | +-------+------------+------------+------------+------------+---------------+ | abc12 | Bobby | Caily | * | * | b@example.com | | ... | ... | ... | ... | ... | ... | +-------+------------+------------+------------+------------+---------------+ ERROR ENCOUNTERED: Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/.../public_html/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(32) : eval()'d code on line 4 Invalid or no security key! Code: <script> function invite(){ document.getElementById('invite').style.display=(document.getElementById('invite').style.display=='block')?'none':'block'; } </script> <script> function returnHome(){ setTimeout(function () {window.location.href = 'http://example.com';},2000); } </script> $part = $_REQUEST['id']; if(isset($_GET["id"])){ $query = sprintf("SELECT * FROM `DATABASE`.`TABLE` WHERE idquack='$part'", mysql_real_escape_string($query)); $result = mysql_query($query); if (!$result) { $message = 'Invalid or no security key!'; die($message); } else { while ($row = mysql_fetch_assoc($result)) { if ($row['Metgesel'] != "*"){ if ($row['Metgesel'] == "#"){ if ($row['Kind1'] != "*"){ if ($row['Kind2'] != "*"){ echo '<h1>' . $row['Naam'] . ", " . "Metgesel" . ", " . $row['Kind1'] . " en " . $row['Kind2'] . "</h1>"; } else { echo '<h1>' . $row['Naam'] . ", " . "Metgesel" . " en " . $row['Kind1'] . "</h1>"; } } else { echo '<h1>' . $row['Naam'] . " en " . "Metgesel" . "</h1>"; } } else{ if ($row['Kind1'] != "*"){ if ($row['Kind2'] != "*"){ echo '<h1>' . $row['Naam'] . ", " . $row['Metgesel'] . ", " . $row['Kind1'] . " en " . $row['Kind2'] . "</h1>"; } else { echo '<h1>' . $row['Naam'] . ", " . $row['Metgesel'] . " en " . $row['Kind1'] . "</h1>"; } } else { echo '<h1>' . $row['Naam'] . " en " . $row['Metgesel'] . "</h1>"; } } } else { echo '<h1>' . $row['Naam'] . "</h1>"; } echo '<script>invite();</script>'; } } mysql_free_result($result); } else{ echo 'Hold on tight - we're taking you to safety!'; echo '<script>returnHome();</script>'; }
  3. Hi all, I created a page template at http://www.durgeshsound.com/gallery/ Here my pagination buttons are not working. this issue arises when permalink format is http://www.example.com/sample-post/ But when I set permalink format to default (www.example.com/?p=123) then it starts to work and creates a working pagination link like this http://www.durgeshsound.com/?page_id=81&paged=2. I want this format http://www.example.com/sample-post/ in the links. Please help.
  4. Hello all, I feel pretty good that I got my AJAX filter working properly. But it still needs some help. Now I am returning the content with Ajax that I want from the search filter of dropdown option (keep in mind there are several options to filter by). But the content returned is often to much to fit on one page - so I need to paginate the successfully returned html from my AJAX call. Here is where I get stumped. Do I setup a normal page nav outside the AJAX area? </div><!-- AJAX return container--> <nav class="pagenav"> <ul id="pag-link"> <li class="old"><?php next_posts_link('« Older Sermons', $sermons_query->max_num_pages) ?></li> <li class="new"><?php previous_posts_link('Newer Sermons »', $sermons_query->max_num_pages) ?></li> </ul> </nav> IF so, how do I update the links info? or do I keep the page nav inside the AJAX area but use some custom code to retrieve the proper link? (I tried using the normal wordpress page nav functions in my php function but they provide the url of the page that the php function is on, not the actual page being viewed). Do I need to make a separate AJAX call to a function that just builds my links? or is there a way to do it with my main call? Here is my AJAX call: //Listen for the menu's to change except the main filter_by dropdown var ids = ['filter_preacher_dropdown', 'filter_sort_by_dropdown', 'filter_per_page_dropdown', 'filter_series_dropdown', 'filter_service_dropdown', 'filter_tag_dropdown', 'filter_book_dropdown', 'filter_year_dropdown']; $('#' + ids.join(',#')).change(function(e) { var pt = [ "preacher","series","service" ]; if($.inArray(this.name, pt)!==-1){ var mk = this.name; var mv = $(this).val(); var ppp = $("#filter_per_page_dropdown").val(); var ob = $("#filter_sort_by_dropdown").val(); var data = { action: 'filter_sermons', meta_key: mk, meta_value: mv, posts_per_page: ppp }; $.post(mbsb_ajaxurl, data, function(response) { $('#sermonlists').fadeOut('slow', function() { $(this).html(response) }).fadeIn('slow'); }); } and here is my php function (slightly paired down for viewing ease): //ajax for sermons filter add_action('wp_ajax_filter_sermons', 'check_ajax'); add_action('wp_ajax_nopriv_filter_sermons', 'check_ajax'); function check_ajax() { global $wpdb, $paged, $max_num_pages; //check if filter is on post_type if($_POST['meta_key']){ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $mk = '"'.$_POST['meta_key'].'"'; $mv = intval($_POST['meta_value']); $ppp = intval($_POST['posts_per_page']); $offset = ($paged - 1) * $ppp; $sermons = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS sermons.* FROM {$wpdb->prefix}posts AS sermons, {$wpdb->prefix}postmeta WHERE meta_key = {$mk} AND meta_value = {$mv} AND sermons.ID = {$wpdb->prefix}postmeta.post_id LIMIT {$offset}, {$ppp}", OBJECT); $sql_posts_total = $wpdb->get_var( "SELECT FOUND_ROWS();" ); $max_num_pages = ceil($sql_posts_total / $ppp); }elseif($_POST['name']){ //another custom query }elseif ($_POST['book_number']){ //another custom query } $posts = get_posts(); // returns posts in an array if($sermons) { global $post; foreach ($sermons as $post){ setup_postdata($post); //custom query info returned here } //Would the Pagination for the AJAXED content go here? }else{ ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php } die(); }
  5. I have a Google Adsense code that I am saving to the wp_options table. I can successfully save and retrieve the variable containing the google adsense code but it doesn't do anything except display it as plain text on screen. How can I make this html/javascript in the variable actually load in page as HTML/JS instead of as plain text??? this is the example of the code that I'm saving to the database and retrieving.... <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- EggSquat main banner ad --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" data-ad-slot="XXXXXXXX"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> ....... may I should make a custom post type and just display a post, and use that instead of a single field saving to database
  6. hello all, I am trying to use ajax, to filter my custom post_type using a dropdown (several actually, but just working on one now). when I check the console.log for my two variables the log returns the values that I need to pass into my function check_ajax() I am using to do the filtering, but when I check the log for the data array it comes up with 0? Here is my Jquery code: //Listen for the menu's to change except the main filter_by dropdown var ids = ['filter_preacher_dropdown', 'filter_sort_by_dropdown', 'filter_per_page_dropdown', 'filter_series_dropdown', 'filter_tag_dropdown', 'filter_book_dropdown', 'filter_year_dropdown']; $('#' + ids.join(',#')).change(function() { var sermonForm = $("#sermon_filter_form"); var myForm = $(this).closest("form"); var meta_key = this.name; var meta_value = $(this).val(); var current_selection = $(this); var ajaxLoader = '<div class="loading_img"></div>'; $(this).after(ajaxLoader); $.ajax ( { type: "POST", url: ajax_object.ajax_url, data: { 'action': 'filter_sermons', 'meta_key': meta_key, 'meta_value': meta_value, }, dataType: 'JSON', success:function(data){ console.log(data); } } ); }); and here is my function.php code: //ajax for sermons filter add_action('wp_ajax_filter_sermons', 'check_ajax'); add_action('wp_ajax_nopriv_filter_sermons', 'check_ajax'); } /** * Sets up custom query for AJAX to filter * */ function my_sermon_query($meta_key, $meta_value) { return new WP_Query( array( 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'post_type' => 'mbsb_sermon' ) ); } function check_ajax() { $mk = intval($_POST['meta_key']); $mv = intval($_POST['meta_value']); $query = my_sermon_query($mk, $mv); echo json_encode($query); die(); } Any ideas what I am missing/doing wrong? Thanks,
  7. Hey all. I'm fairly new to WordPress (not php) and am running into an issue. I need to add link descriptions to 1 of 5 menus on my page. I've read about extending Walker_Nav_Menu() and am attempting that, and it's kinda going well except for one slightly annoying issue - it's returning the wrong menu. I'm attempting to isolate the action to a menu with the slug 'subbrand-menu'. All the code follows: mytheme/functions.php require_once('classes/FunctionClass.php'); $fn = new MyDev\FunctionClass(); add_filter('wp_get_nav_menu_items',array($fn,'buildSubbrandMenu'),10,2); mytheme/classes/FunctionClass.php namespace MyDev; class FunctionClass{ private $_walker; public function buildSubbrandMenu($menu, $args){ if(\is_admin() || $args->slug !== 'subbrand-menu'){ return $menu; } if(empty($this->_walker)){ require_once('MyWalker.php'); $this->_walker = new MyWalker; } \wp_nav_menu(array( 'menu' => 'subbrand_menu', 'container' => 'div', 'container_class' => 'menu-subbrand-menu-container', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => 'menu-subbrand-menu', 'echo' => true, 'walker' => $this->_walker )); } } mytheme/classes/MyWalker.php namespace MyDev; class MyWalker extends \Walker_Nav_Menu{ public function end_el(&$output, $item, $depth=0, $args=array()) { $output .= "<span class='thisisadescr'>Testing, testing</span></li>"; } } Now, the above actually works quite well except that it's outputting the contents of a menu with the slug 'floater'. Anybody have any ideas what I'm missing here? I'm sure it's something simple but it's driving me crazy right now. Thanks in advance for any and all thoughts, hints, tips, and ideas.
  8. Hi everyone, newbie to site looking for help with my tag/category page formatting. I recently bought a plugin for masonry and have been trying to make it the display for posts on my blog pages as you can see here: http://www.enduringepilepsy.com/_blog/ and http://www.enduringepilepsy.com/archive/_2013 It's been helping my design and page load overall (Note: I do use Google Page Speed Service) But I cannot figure out how to be able to use this customizable masonry for my tag/category pages since they do no show the ability to edit on the Wordpress admin bar. I've looked at the php code in my files, and while I have become more familiar with php in the yr since I moved to Wordpress, am unsure how to edit these pages without making a mess. The plugin is http://codecanyon.net/item/essential-grid-wordpress-plugin/7563340 My theme, called Inzin, is no longer sold, and the developer disappeared from online. So I have lost all support. I would really appreciate any help anyone could offer. Thank you!
  9. Hi guys, Having some trouble entering some php into my wordpress site that runs on Optimize Press. I'm trying to insert this URL/ tracking code into my page as a hyperlink - 'Click Here Now'. http://www.mysite.com/offer.php?g=TinnitusMiracleTest1_50onRed&sub1=<?php echo $sub1; ?>&sub2=<?php echo $sub2; ?>&sub3=<?php echo $sub3; ?>&sub4=<?php echo $sub4; ?>&sub5=<?php echo $sub5; ?>&lpid=<?php echo $lpid; ?> This is what I have done so far: <a href="http://www.mysite.com/offer.php?g=TinnitusMiracleTest1_50onRed&sub1=<?php echo $sub1; ?>&sub2=<?php echo $sub2; ?>&sub3=<?php echo $sub3; ?>&sub4=<?php echo $sub4; ?>&sub5=<?php echo $sub5; ?>&lpid=<?php echo $lpid; ?>">Click Here Now</a> This does generate a hyperlink, however when I click it, I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=' at line 2 I understand for this code to work the page has to be saved in php. I thought wordpress did this automatically? Can anyone help please? Also, please bear in mind I am using the Optimize Press plugin. Many thanks in advance! Tom
  10. Hello, I have been looking for a way to track the play stats on audio mp3's in the admin of my custom post-type. Whatever I google seems to come up with nothing. I not very versed in audio player code - could someone please point me in the right direction. Again: I have a custom post-type which uses the wordpress default audio. I would like to get the number of plays for each audio file and display that in the admin column for my custom post-type Thanks, Drew
  11. I have noticed 2 script errors on my site within the .php files but can't see why they're occurring. The first appears at the bottom of my wordpress admin page: Notice: Array to string conversion in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 123 This is the area in that file: `$srce = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir($srce) ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; return true; } else { $this->ext_handles .= "$handle,"; $this->ext_version .= "$handle$ver"; } }` Line 123 is: $this->ext_version .= "$handle$ver"; The other error i am getting is: Notice: Undefined index: prettyPhoto in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 185 Notice: Trying to get property of non-object in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 185 These are lines 183-194 in that file:` function set_group( $handle, $recursion, $group = false ) { if ( $this->registered[$handle]->args === 1 ) $grp = 1; else $grp = (int) $this->get_data( $handle, 'group' ); if ( false !== $group && $grp > $group ) $grp = $group; return parent::set_group( $handle, $recursion, $grp ); }` Line 185 is: if ( $this->registered[$handle]->args === 1 ) Can anyone help solve these errors? The full file can be seen here: http://pastebin.com/spBAhuHf Here is a link to one of the pages in the website which shows the second error. http://test.orkneywine.co.uk/online-store/elderberry-borealis-35cl/ Can anyone help with this?
  12. I like to set up websites for people who don't have the know how to do it themselves, I mainly set them up wordpress sites cuz thats pretty easy for them to modify and maintain themselves. To save myself time, I decided to learn how to do it with Composer (what a brilliant tool that it). Can anyone who uses composer for this kinda thing, can you post your composer.json files here. Also, if anyone can show me a better way of doing things, it'd be much appreciated. Heres the one I made: { "name": "acme/brilliant-wordpress-site", "description": "My brilliant WordPress site", "repositories":[ { "type":"composer", "url":"http://wpackagist.org" } ], "require": { "johnpbloch/wordpress": ">=3.8.0", "wpackagist-plugin/captcha":">=3.9", "wpackagist-plugin/tinymce-advanced":">=4.0.0", "wpackagist-plugin/wordpress-importer":"*", "wpackagist-theme/hueman":"*", "wpackagist-theme/eclipse":"*", "wpackagist-theme/raindrops":"*" }, "extra": { "installer-paths": { "mysite": ["johnpbloch/wordpress"], "mysite/wp-content/plugins/{$name}": ["type:wordpress-plugin"], "mysite/wp-content/themes/{$name}": ["type:wordpress-theme"] } }, "autoload": { "psr-0": { "Acme": "src/" } } } I think I'm doing this in a silly way though. I read about these composer installer things on github, but I didn't figure out how to use them so instead I used the installer-paths key to make the autoloader put the files in the right place. Heres a composer.json file I found which is better cuz it uses a post installation script: { "require": { "wordpress/core": "3.5.2", "wordpress/twentytwelve": "1.1", "wordpress/akismet": "2.5.7", "wordpress/google-sitemap-generator": "3.2.9", "wordpress/google-analytics-for-wordpress": "4.3.3", "wordpress/wordpress-importer": "0.6.1" }, "repositories": [ { "type": "composer", "url": "https://raw.github.com/wordpressoncomposer/composer-repository/master/" }, { "type": "vcs", "url": "https://github.com/wordpressoncomposer/installer" } ], "scripts": { "post-install-cmd": "Wordpress\\Composer\\InstallerTasks::wpConfig" }, "extra": { "wordpress_coredir": "wordpress/core", "wordpress_wp_contentdir": "wordpress/wp-content", "wordpress_wp_config": { "site_url": "http://localhost", "db_host": "localhost", "db_user": "root", "db_pass": "", "db_name": "wordpress" } }, "minimum-stability": "dev" } I'm gonna start using these scripts once I figure out how to use them. Where are the scripts stored? I haven't a clue what this autoload thing is all about either, is it a tool for moving files into the appropriate directories? See how the first file gets wordpress from packagist, and the second one gets it from github. Is there a difference? If I was to add that post-install-cmd key to the first composer.json file, would it still work? In other words, do both repositories contain identical packages.
  13. I am working on a site Wordpress site where I have used a plugin to create some custom fields that appear when a user is creating a new page. The code below is a snipet from the template that calls those custom fields and places the user input into the proper sections of the page. The first line is working perfectly, the second piece of code is where my error is coming from. The code in bold is the call to the user input url. I need this to be input into the button shortcode. I am not very experienced with php, so I am hoping that I have just made a simple syntax error. Any help would be greatly appreciated! .... <p><?php echo types_render_field("copy-section");?></p> <?php echo do_shortcode('[button color="accent-color" hover_text_color_override="#fff" size="large" url="' . echo types_render_field("signup-link"); . '" text="SIGN UP TODAY - It's Free and Secure!" color_override="#d28743"]'); ?> ....
  14. Simplified for everyone's sanity and re-posted. Got a Wordpress Conference theme, lets you enter speakers into a database and assign each one a category/role. In the settings for the theme, there's a dropdown from which you can select one of the roles you create. Doing so will display all the speakers assigned that role in the footer of the homepage and also populate a stand-alone Speakers page with the same role. I want to make it so that the footer on the homepage displays one role and the stand-alone speaker page displays another. Here's the PHP for the Speakers page (identical to the footer PHP) <?php /** * Template Name: Speakers page * Description: Speakers page * * @package WordPress * @subpackage wpconference * @since wpconference 0.1 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <h1 class='entry-title'><?php the_title(); ?></h1> <?php global $conf_sched; $speakers_category = $conf_sched->get_option('speakers-category',-1); if($speakers_category !=-1){ $speaker = get_term($speakers_category, 'participant-roles'); $conf_sched->shortcode_participants(array('role'=>$speaker->slug)); }else { _e("To be annouced...",'wpconference'); } ?> </div> <!-- #content --> </div> <!-- #primary --> <?php get_footer(); ?> Here's the HTML for the "dropdown" portion of the settings, where you can see the role categories available. "Speaker" is the default created by the Theme, "whyattend" is the one I made. <!-- Speakers Category --> <tr valign="top"><th scope="row">Speakers Category</th> <td> <select name='conf_sched[speakers-category]' id='cat_speakers' class='postform' > <option value='-1'>&#8212;</option> <option class="level-0" value="2">Speaker</option> <option class="level-0" value="17" selected="selected">whyattend</option> </select> <br /> <span class="description">Please choose which category is your speakers category. If none is available please go to Participants menu and add a new role speakers</span> </td> </tr> I want "whyattend" to show on the Footer and "Speaker" to populate the Speakers page. Can this be done?
  15. Howdy colleagues, Please help! I am writing a WP plugin the boss of the website to be notified when an admin logs in. So far so good, but I can't make the damn code to send the email when the user logs in. If I change the add_action to "admin_notices" the email is being sent, but if I put "wp_login" it does not Please help, here is the code so far... function _emnoti_get_time_of_login(){ $time_of_login = date('l F Y'); return $time_of_login; } # Get the IP of the user that logged themselves as admin function _emnoti_get_ip(){ $sources = array( 'REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', ); foreach ($sources as $source) { if(!empty($_SERVER[$source])){ $ip = $_SERVER[$source]; } } return $ip; } # Email all the info above to a pointed email address function emnoti_send_email($user_login, $user){ if(_emnoti_check_if_admin() === true){ // print _emnoti_get_time_of_login(); // print _emnoti_get_ip(); wp_mail("MY EMAIL!", "Test subject", 'test body'); } } add_action('wp_login', 'emnoti_send_email', 10, 2); ?>
  16. I am trying to use a Wordpress module called WooCommerce PDF Invoices to make event tickets by modifying the layout of the invoice to create an online ticket to printout. I've successful reformatted the layout and it works like a charm except for one thing. The problem I have is that no matter what is bought the invoice reads "This is a ticket" which I hardcoded into the invoice design. What I would like is an if/then statement inserted into the invoice design that will print between "This is a ticket" or "This is a receipt" depending on if they purchase one of the 4 ticket items. I completely redesigned the woocommerce pdf invoice to look like an online ticket. The first half looks like an actual ticket. <?php global $wpo_wcpdf; ?> <table align="center" cellpadding="0" cellspacing="0" class="pdfbackground" style="width: 700px; height: 350px"> <tr> <td style="width: 20px"> </td> <td style="width: 285px"> </td> <td style="width: 300px"> </td> <td style="width: 75px"> </td> <td style="width: 20px"> </td> </tr> <tr> <td rowspan="4" style="width: 20px"> </td> <td class="pdflogo" rowspan="4" style="width: 285px"><br /><div id="container"><div><?php if( $wpo_wcpdf->get_header_logo_id() ) { $wpo_wcpdf->header_logo(); } else { _e( 'Ticket', 'wpo_wcpdf' ); } ?></div><div class="order-information"> <br /><br /><hr width=50% color=#0087E1><?php $date_setting = isset($wpo_wcpdf->settings->template_settings['display_date'])?$wpo_wcpdf->settings->template_settings['display_date']:'order_date'; $number_setting = isset($wpo_wcpdf->settings->template_settings['display_number'])?$wpo_wcpdf->settings->template_settings['display_number']:'order_number'; // set $display date & label to user setting if ( $date_setting == 'invoice_date' ) { $display_date = $wpo_wcpdf->get_invoice_date(); $display_date_label = __( 'Event Date:', 'wpo_wcpdf' ); } else { $display_date = $wpo_wcpdf->get_order_date(); $display_date_label = __( 'Order Date:', 'wpo_wcpdf' ); } // set $display number & label to user setting if ( $number_setting == 'invoice_number' ) { $display_number = $wpo_wcpdf->get_invoice_number(); $display_number_label = __( 'Transaction Number:', 'wpo_wcpdf' ); } else { $display_number = $wpo_wcpdf->get_order_number(); $display_number_label = __( 'Order Number:', 'wpo_wcpdf' ); } ?> <span class="order-date-label"><?php echo $display_date_label; ?></span> <span class="order-date"><?php echo $display_date; ?></span><br /> <span class="order-number-label"><?php echo $display_number_label; ?></span> <span class="order-number"><?php echo $display_number; ?></span><br /> <br /> <br /> </div></div></td> <td style="width: 300px"><div class="shop-name"><h3><?php $wpo_wcpdf->shop_name(); ?></h3><br /> SPONSORED BY: <br />SPONSOR 1 LOGO | SPONSOR 2 LOGO </div> </td> <td rowspan="4" style="width: 75"><br /><br /><br /><br /><br /><br /> <img alt="" height="126" src="http://www.3corlando.com/wp-content/uploads/2014/06/barcode.png" width="71" class="barcode" /></td> <td rowspan="4" style="width: 20px"> </td> </tr> <tr> <td style="width: 300px"><hr width=75% color=#0087E1><div class="shop-address"><?php $wpo_wcpdf->shop_address(); ?></div> </td> </tr> <tr> <td style="width: 300px"> </td> </tr> <tr> <td style="width: 300px"></td> </tr> <tr> <td class="pdfborder" style="width: 20px"> </td> <td class="pdfticket" colspan="3"><div class="pdfticket"><hr width=50% color=#0087E1>***This is a Receipt*** </div> </td> <td class="pdfborder" style="width: 20px"> </td> </tr> </table> And the second half looks like an invoice. <!-- head container --> <hr> <table class="order-details"> <thead> <tr> <th class="product-label"><?php _e('Shop Items', 'wpo_wcpdf'); ?></th> <th class="quantity-label"><?php _e('Quantity', 'wpo_wcpdf'); ?></th> <th class="price-label"><?php _e('Price', 'wpo_wcpdf'); ?></th> </tr> </thead> <tbody> <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr> <td class="description"> <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?> <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span> <dl class="meta"> <?php if( !empty( $item['sku'] ) ) : ?><dt><?php _e( 'SKU:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['sku']; ?></dd><?php endif; ?> <?php if( !empty( $item['weight'] ) ) : ?><dt><?php _e( 'Weight:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?> </dl> </td> <td class="quantity"><?php echo $item['quantity']; ?></td> <td class="price"><?php echo $item['order_price']; ?></td> </tr><?php endforeach; endif; ?> </tbody> <tfoot> <tr class="no-borders"> <td class="no-borders" colspan="3"> <table class="totals"> <tfoot> <?php foreach( $wpo_wcpdf->get_woocommerce_totals() as $total ) : ?> <tr> <td class="no-borders"> </td> <th class="description"><?php echo $total['label']; ?></th> <td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td> </tr> <?php endforeach; ?> </tfoot> </table> </td> </tr> </tfoot> </table><!-- order-details --> <table class="notes container"> <tr> <td colspan="3"> <div class="notes-shipping"> <?php if ( $wpo_wcpdf->get_shipping_notes() ) : ?> <h3><?php _e( 'Customer Notes', 'wpo_wcpdf' ); ?></h3> <?php $wpo_wcpdf->shipping_notes(); ?> <?php endif; ?> </div> </td> </tr> </table><!-- notes container --> <?php if ( $wpo_wcpdf->get_footer() ): ?> <div id="footer"> <?php $wpo_wcpdf->footer(); ?> </div><!-- #letter-footer --> <?php endif; ?> I want to identify one of my 4 ticket items that may appear where the invoice prints the items and when one of them does appear it changes "This is a receipt" to "This is a ticket" in the first half. Is something like this possible? If so, can anyone give me a direction to find the coding for this? Can anybody give me an idea how to write this in php. I'm a pro at html but I've only taught myself how to modify existing php coding. I can't write it from scratch. Any help is appreciated.
  17. Hi I would really appreciate some help. I am trying to structure some php to detect if a value is null, if it is not null i want it to print the value if null print nothing. so far all i have it doing is detecting whether it is null or not. but it is printing part of my code instead of the fields value. here is the code I have this is for a word press theme that I am modifying for my purpose. <td colspan="7" class="hideme"> '. (get_post_meta($post->ID,"_as_pros",true)!="" ? '(get_post_meta($post->ID,"_as_pros")' : '') .' </td>
  18. Greetings all, Been trying to make a plugin in wordpress and ran into an issue with the way wordpress makes use of ajax in the administration menu. The problem is that I completely don't understand it. I've read all the docs on it and even tried messing with a variety of tutorials on the matter to no avail. What I am trying to do is a simple task outside of wordpress. The form has two select fields, the first field populates the second selection field. While this works fine on a standard html page, trying to do it in wordpress is another story. Form.php: <div id="wrapper"> <h1>Second dropdown selection based </h1> <form action="" method="post"> <p><label>Main Menu :</label> <select name="main_menu_id" id="main_menu_id"> <option value="">Select</option> <?php // Connect to database. $connect = mysqli_connect('<!--DB connection info-->"); $q = mysqli_query($connect, "SELECT cfid,cfname FROM categoryfiles ORDER BY cfid"); while($row = mysqli_fetch_array($q)) { echo '<option value="' . $row['cfname'] . '">' . $row['cfname'] . '</option>'; } ?> </select> </p> <p><label>Sub Menu: </label> <select name="sub_menu_id" id="sub_menu_id"></select> </p> </form> </div> The script.js $(function() { $("#main_menu_id").bind("change", function() { $.ajax({ type: "GET", url: "scripts/get_sub_category.php", data: "main_menu_id="+$("#main_menu_id").val(), success: function(html) { $("#sub_menu_id").html(html); } }); }); }); The get_sub_category.php <?php // Connect to database. $connect = mysqli_connect('<!--My connection info-->); $id = $_GET['main_menu_id']; $q = mysqli_query($connect, "SELECT sfid, sfname FROM subjectfiles WHERE sfcategory='" . $id . "' ORDER BY sfname"); while($row = mysqli_fetch_array($q)) { echo '<option value="' . $row['sfname'] . '">' . $row['sfname'] . '</option>'; } ?> Like I said, it works just fine outside of wordpress so really I just need help getting it to work in wordpress. I just don't understand it. Thanks to anyone that takes the time to look this over. Best Regards, Nightasy
  19. Looking for some technical assistance on a property search query im having some problems with on WP. Using the Agentpress theme I have put together a client site that is fully functional, however the client has asked that the search is altered is altered slightly and i'm having trouble working out how to do it. I'm not a database / PHP person - I have managed so far, but this is beyond my understanding. I have 2 separate search query issues. The first is that my client wants the bedrooms to be searchable with the following options: 1 or more 2 or more 3 or more 4 or more The second is that they want the availability of the property to only give 2 options: Availabile properties only Include Let Agreed Here is the site: test.taylorslettings.co.uk The property data and field names I have are being automatically created by their system and provides the information in the dropdowns as you see it in the search box on the site. The theme (Agentpress) dictates the search and how it works at present. I have no idea how to alter the search so it shows presents the results to meet the clients needs. We are at the very end stages of going live, so any urgent help would be gratefully appreciated. Thanks very much.
  20. Hey Everyone. I am hoping this is the right place to ask this question. I am using a new WordPress theme and it has native related post coding in it. The problem is the code uses Post Tags as the selection value instead of Post Category. I was wondering if anyone could help me with this strip of code. I want to change it so the theme gets Posts in the same Category, instead of Posts with the same Tags. * Display related posts. * * @return void */ function stag_related_posts() { global $post; if( stag_rcp_user_has_no_access() ) return; if( ! stag_theme_mod( 'post_settings', 'show_related_posts' ) ) return; $tags = wp_get_post_tags( $post->ID ); if ( count( $tags ) ) { $tags_ids = array(); foreach($tags as $individual_tag) { $tag_ids[] = $individual_tag->term_id; } $query = new WP_Query( array( 'tag__in' => $tags_ids, 'post__not_in' => array( $post->ID ), 'posts_per_page' => absint( stag_theme_mod( 'post_settings', 'related_posts_count' ) ), 'caller_get_posts' => 1 ) ); // Add filter to attach 'post-grid' class add_filter( 'stag_showing_related_posts', '__return_true' ); if( $query->have_posts() ) : echo '<section class="related-posts" data-layout="2-2-2-2">'; while( $query->have_posts() ) : $query->the_post(); get_template_part( 'content', get_post_format() ); endwhile; echo '</section>'; endif; } wp_reset_query(); remove_all_filters( 'stag_showing_related_posts' ); } I've tried simply replaces the words Tags with Categories, but it doesn't seem to do much. Any help would be greatly, greatly, appreciated.
  21. PHP Warriors, Please help I am trying to write a function in the genesis framwork that would allow me to add before_content_sidebar_wrap only on page_blog.php for my slider but can't seem to get it to work! I notice that the wrap and hook are added successefully but they display in every page instead of the blog only. Any help would be greatly appreciated. Here is my function add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap'); if ( ! ( is_page_template( ‚page_blog.php‚ ) ) ) return; and here is my website I am displaying the slider on. It should be only on the blog page; mainlinerealtors.com/blog/ Thanks a lot,
  22. I am trying to change the size of the Excerpt box for new posts. I know how to change the excerpt word length in the php code but can't find a solution to changing the size of the box itself. Any help would be appreciated
  23. Dear users, I'm offering my services to all of whom view this post, I'm a website developer from the United Kingdom, and I've been specialising with website development for 4 years now. Initially, I would be happy to setup client's websites from $80 which would be a custom made theme which would either integrate within my own CMS, or other systems such as WordPress. Alongside that, I'm also happy to code custom websites for anyone wishing to have custom scripts developed for certain purposes, for example, a 'booking system' for a 'taxi service'. You can view my businesses website, to view my price range, services, and portfolio at: http://www.x5host.co.uk If you have any questions, please contact me at info@x5host.co.uk. I'd be more than happy to answer any questions / queries that you may have about websites / the process of development, or just to enquire about possible low prices for your new website. Feel free to also take a look at my newly setup blog to get a greater idea of who I am personally, and how I work with clients. http://www.jason-moore.co.uk. Kind Regards, Jason Moore.
  24. I did not know which section I should publish this topic but I assumed it is PHP related. Any ideas from inspecting the code what kind of plugins this site is using to display the category posts as a gallery at the top? http://www.zillow.com/blog/ Any help would be greatly appreciated, Thanks,
  25. Hello All, I am trying to turn a PHP application I made about a year ago into a WordPress plugin. I'm reasonably new in the world of WordPress plugins and have what I think will be a simple question. My plugin creates a shortcode, and when the WordPress page with that short code on is loaded, the program calls a function and displays it. My question is, within that function, how do I create a link or button (or something else) which will run the chosen function. Here is what I mean: function welcome() { ?>Welcome. This is the first screen of the plugin. Click <a href="???">here</a> to register. } function register() { register here } How would I make the above piece of code work. My thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.