Jump to content

Search the Community

Showing results for tags 'wordpress'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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 (Dreamweaver, Zend, 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 61 results

  1. We have a wordpress install with the plugin wp-job manager installed. https://wpjobmanager.com We add and manage jobs via YouRecruit but we want to update them to our wordpress database (wp-job manager) every time they're added, updated or we deleted. We also have a plugin/api module from YouRecruit which extends the wp job manager plugin and enables us to post and delete jobs to wp-job manager using xml. This is all the documentation I have on the API module from YouRecruit below and there are no settings in the back end of wordpress for you to fill in. Based on what I have read below I am assuming the plugin handles most of the processing but you still have to write your own PHP script and host it at 'http://www.yoursite.com/jobload/get_job.php' for example. At least this is what it says. I'm thinking were going to have to fetch the xml with simple_xml there is a brief code snipped in the documentation on doing this. I then don't know where to go from there or if this is the correct way to go about dealing with this issue. http://yourecruit.com/resources_public/wordpress_job_manager_api.php http://yourecruit.com/resources_public/own_site_posting.php Could anyone confirm if I am thinking along the right lines here. Thanks your advice is very much appreciated.
  2. I have some files saved outside the webroot and need to allow posts in WordPress to be able to access the files. Following is the location of one of the files: /home1/Mathone/TESTS/Test1/index1.html I created a Download.php file with the following code and saved it to public_html of my site: <?php $path = '/home1/Mathone/TESTS/'. $_GET['filename']; $mm_type="application/octet-stream"; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: " . $mm_type); header("Content-Length: " .(string)(filesize($path)) ); header('Content-Disposition: attachment; filename="'.basename($path).'"'); header("Content-Transfer-Encoding: binary\n"); readfile($path); // outputs the content of the file exit(); ?> Next, I created a post in wordpress with the following link: <a href="www.mysite.com/download.php?filename=Test1/index1.html">download</a> I am getting an error This is somewhat embarrassing, isn’t it? It seems we can’t find what you’re looking for. Perhaps searching can help. Can anyone tell me what I am doing wrong? Thank you
  3. I'm editing the Woocommerce e-mail files, and have got a session working. When it's echoed on the e-mail it appears as expected - "1 Day Health & Safety Awareness Chelmsford". However the if statement is not working. This is shown below, can anyone tell me where I'm going wrong? if (strpos($_SESSION['ahsname'], 'safety awareness') !== false) { // This is what I want to happen, the session should (and does) contain the string shown above //include( get_template_directory() . '/instructions/chelmsford-hsa-ahs.html'); echo "YES"; }else{ // This should not happen but it does! echo "NO "; echo $_SESSION['ahsname']; // the session is echoed with the bit I'm checking for included as mentioned above }
  4. I have made a custom post type for products, and am using a custom taxonomy for the product categories. The thing that I am wondering about is that sometimes a product category is a parent, and sometimes a child, but sometimes both. For instance, if you have a top level category named shoes, then you might have a sub category named Nike. However, Nike also has shirts, so you could say that shoes and shirts were both subcategories of Nike. Do you know what I'm saying? It's like there is no real parent to child relationship, but they are both parents and both children of each other. How do you handle this type of situation?
  5. Good morning I'm trying to add a widget to a WordPress template using PHP. It works, but the problem is that the widget ends up on a new line in the header instead of next to the logo as I want it. The code looks like this: <div class="branding_wrap"> <?php pagelines_main_logo(); ?> <?php pagelines_register_hook( 'pagelines_before_branding_icons', 'branding' ); // Hook ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('header-1') ) : ?> <?php endif; ?> I've attached a screenshot of the current header to this post. Can anyone tell me what I'm doing wrong? I'm pretty new at PHP. Thank you!
  6. Hi, I'm new to this forum and I'm Italian, so I'm so sorry for my bad English. Anyway, I need some help with header of my blog, I hope someone can help me! I'm not an expert of php I bought a new theme for my blog (the developer doesn't help with code), and I found this problem: logo has a fixed width, I have to change it to have a bigger logo, and to put an ads on the right. The code is below, the theme can be viewed at this url http://www.industrialthemes.com/engine/ Any help or suggestions are accepted. Thanks in advance! <?php $postid = isset($post) ? $post->ID : ''; #theme options $logo_url=it_get_setting('logo_url'); $logo_url_hd=it_get_setting('logo_url_hd'); $logo_width=it_get_setting('logo_width'); $logo_height=it_get_setting('logo_height'); $logo_color_disable=it_get_setting('logo_color_disable'); $link_url=home_url(); $dimensions = ''; $tagline_disable = true; if(!it_get_setting('description_disable') && get_bloginfo('description')!=='') $tagline_disable = false; #category specific logo $category_id = it_page_in_category($postid); if($category_id) { $categories = it_get_setting('categories'); foreach($categories as $category) { if(is_array($category)) { if(array_key_exists('id',$category)) { if($category['id'] == $category_id) { if(!empty($category['logo'])) $logo_url=$category['logo']; if(!empty($category['logohd'])) $logo_url_hd=$category['logohd']; if(!empty($category['logowidth'])) $logo_width=$category['logowidth']; if(!empty($category['logoheight'])) $logo_height=$category['logoheight']; if(array_key_exists('tagline_disable',$category)) { if($category['tagline_disable']) $tagline_disable = true; } break; } } } } } if(!empty($logo_width)) $dimensions .= ' width="'.$logo_width.'"'; if(!empty($logo_height)) $dimensions .= ' height="'.$logo_height.'"'; $termargs = array('num' => 7, 'tax' => array('post_tag','category')); ?> <?php if (!it_component_disabled('header', $postid)) { ?> <div class="container-fluid no-padding"> <div id="header-bar"> <div class="row"> <div class="col-md-12"> <div id="header-inner" class="container-inner"> <?php echo it_background_ad(); #full screen background ad ?> <?php if(!it_component_disabled('logo', $postid)) { ?> <div id="logo"<?php if($logo_color_disable) { ?> class="no-color"<?php } ?>> <?php if(it_get_setting('display_logo') && $logo_url!='') { ?> <a href="<?php echo $link_url; ?>/"> <img id="site-logo" alt="<?php bloginfo('name'); ?>" src="<?php echo $logo_url; ?>"<?php echo $dimensions; ?> /> <img id="site-logo-hd" alt="<?php bloginfo('name'); ?>" src="<?php echo $logo_url_hd; ?>"<?php echo $dimensions; ?> /> </a> <?php } else { ?> <h1><a class="textfill" href="<?php echo $link_url; ?>/"><?php bloginfo('name'); ?></a></h1> <?php } ?> <?php if(!$tagline_disable) { ?> <div class="subtitle"><?php bloginfo('description'); ?></div> <?php } ?> </div> <?php } ?> <?php if(!it_component_disabled('header_posts', $postid)) { ?> <div id="header-posts"> <div align="center"> SOMETHING IS CHANGING!!! <br /> TESTING <br /></div> </div> <?php } ?> <?php if(!it_component_disabled('header_terms', $postid)) { ?> <?php $terms = it_get_trending_terms($termargs); ?> <div id="header-terms"> <div class="shadowed"> <div class="term-panel first"><span class="theme-icon-flame"></span><span class="trending-label"><?php _e('TRENDING',IT_TEXTDOMAIN); ?></span></div> <?php $i = 0; foreach($terms as $term) { $i++; $cssalt = ($i % 2 == 0) ? '' : ' alt'; ?> <div class="term-panel<?php echo $cssalt; ?>"> <a href="<?php echo get_term_link($term); ?>"><?php echo $term->name; ?></a> </div> <?php } ?> </div> </div> <?php } ?> </div> </div> </div> </div> </div> <?php } ?>
  7. I am using WPSQT plugin in my blog site .I code some files in PHP also.how to add that files in plugin files.
  8. I am using the Starkers Wordpress theme as a foundation for my website and I am having difficulty getting my category.php to paginate posts properly. I am trying to display 10 posts per each page. When I click the 2,3,4,... post pagination button, it open the page but does not actually load new posts. Here is the code I have in my category.php file. Please could you help me to fix this issue? Please let me know if you need me to clarify anything further. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $cat = get_query_var('cat'); $catinfo = get_the_category($cat); ?> <div class="row"> <div class="large-8 small-12 columns"> <h2 class="category-header"><?php echo single_cat_title( '', false );?></h2> <?php if(1 == $paged) { //check if is page one and display main headlines and subcategories?> <?php //get category headline $cat = get_query_var('cat'); $category_headline = ae_get_category_headline($cat); if ($category_headline) { ?> <div class="category-headline"> <?php foreach($category_headline as $post) : setup_postdata($post); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <h3><?php the_title(); ?></h3></a> <?php the_content('Read more...'); ?> <ul class="inline-list main-headline-social"> <li><?php comments_popup_link('Leave a Comment', 'View Comments (1)', 'View Comments (%)'); ?></li> <li class="addthis_toolbox addthis_pill_combo_style"><a addthis:url="<?php the_permalink(); ?>" class="addthis_button_facebook_like"></a><a addthis:url="<?php the_permalink(); ?>" class="addthis_button_tweet"></a><a addthis:url="<?php the_permalink(); ?>" class="addthis_button_compact"></a></li> </ul> <?php endforeach; ?> <?php wp_reset_postdata(); ?> </div> <?php } ?> <div class="all-category-posts"> <h4 class="title">All news in <?php echo single_cat_title( '', false );?></h4> <?php global $post; $args = array( 'posts_per_page' => 10, 'post_type' => 'post', 'cat' => $cat, 'offset' => 1, 'orderby' => 'post_date', 'order' => 'desc', 'post_status' => 'publish', 'suppress_filters' => true, 'paged' => $paged, ); $allposts = get_posts($args); foreach ($allposts as $post) : setup_postdata($post); ?> <article> <header> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(array(80,80), array('class' => 'alignleft')); ?></a> <p class="date"><?php the_time(get_option('date_format')); ?></p> <hr class="rule" /> <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a> </header> <?php the_excerpt(); ?> </article> <?php endforeach; ?> </div> <?php if ($cat == 9) { ?> <div class="whats-hot-videos"> <a href="<?php home_url(); ?>/videos/" title="Hot Videos"><h4 class="title">Hot Videos!</h4></a> <?php global $post; $args = array( 'ae-video-categories' => 'hot-videos', 'number_of_posts' => 4, 'post_type' => 'ae-videos', 'orderby' => 'post_date', 'order' => 'desc', 'post_status' => 'publish', 'suppress_filters' => true, ); $videos = get_posts($args); ?> <ul class="large-block-grid-4 small-block-grid-2"> <?php foreach ($videos as $post) : setup_postdata($post); ?> <?php $videoid = get_post_meta($post->ID, 'videoid', true); ?> <li> <a href="http://www.youtube.com/watch?v=<?php echo $videoid; ?>" rel="wp-video-lightbox" title="<?php the_title();?>"> <?php the_post_thumbnail(); ?> <h6><?php the_title(); ?></h6> </a> </li> <?php endforeach; ?> </ul> <div class="all-videos-link"><a href="<?php home_url(); ?>/videos/" title="All Videos">...More videos</a></div> </div> <?php } ?> <ul class="large-block-grid-2 small-block-grid-2 sub-categories"> <?php $args = array ( 'parent' => $cat, 'type' => 'post', 'hide_empty' => 1, ); $subcategories = get_categories($args); foreach ($subcategories as $category) { ?> <li> <div class="sub-category-headlines <?php echo $category->slug; ?>-subcategory"> <a href="<?php home_url(); ?>/category/<?php echo $category->slug; ?><?php echo "/"; ?>" title="<?php echo $category->name; ?>"><h4 class="title"><?php echo $category->name; ?></h3> <?php $subcategory_posts = ae_get_categoryposts($category->slug, 2); ?> <ul> <?php foreach ($subcategory_posts as $post) : setup_postdata($post); ?> <li class="subcategory-headline"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(array(150,100), array('class' => 'alignleft')); ?> <h3><small><?php the_title(); ?></small></h3> </a> </li> <?php endforeach; ?> </ul> </div> </li> <?php } ?> <?php } //end check if is page one?> </ul> <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?> </div>
  9. Hi, I have a cron job that executes this script every 2 minutes: <?php // LOAD WP-LOAD.PHP require('/opt/bitnami/apps/wordpress/htdocs/wp-load.php'); // INCLUDE AND EXECUTE SCHEDULER.PHP include('/opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/scheduler.php'); ?> When I try to include; /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/scheduler.php: <?php // EXPLODE AND PARSE WP-CONTENT; FUNCTIONS.PHP $parse_uri = explode( '/opt/bitnami/apps/wordpress/htdocs/wp-content', $_SERVER['SCRIPT_FILENAME'] ); // LOAD WP-LOAD.PHP require_once( $parse_uri[0] . '/opt/bitnami/apps/wordpress/htdocs/wp-load.php' ); // LOAD TEMPLATE FUNCTION CheckFunction(); ?> I get the output: ): failed to open stream: No such file or directory in /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/cron.php on line 5 PHP Warning: include(): Failed opening '<?php //PLEASE do NOT move me around. I get cranky when I get moved around //get the wp-load in for the wordpress functions $parse_uri = explode( '/opt/bitnami/apps/wordpress/htdocs/wp-content', $_SERVER['SCRIPT_FILENAME'] ); require_once( $parse_uri[0] . '/opt/bitnami/apps/wordpress/htdocs/wp-load.php' ); //now try calling template function CheckFunction(); ?>' for inclusion (include_path='.:/opt/bitnami/php/lib/php:/opt/bitnami/frameworks/smarty/libs') in /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/cron.php Any ideas on how to execute this file. Any help would be appreciated.
  10. This is working code that gets the data from a field that registered users have to fill out in their profiles in wordpress: <?php $field = xprofile_get_field_data(2, $user_id); echo '<span class="wisfb_carNumber">' . $field . '<span>'; ?> This is the code that generates data from a Excel-file: <?php $data = wp_excel_cms_get("EXCEL-DOCUMENT"); ?> <?php foreach($data as $entry): ?> <?php echo $entry[1]; ?> <?php endforeach; ?> Now I want to do this: If the number witch is generated in: <?php echo $entry[1]; ?> is the same number as in the users: $field = xprofile_get_field_data(2, $user_id); get this users avatar: echo get_avatar(); Does anyone have an idea on how to do this?
  11. as i m newbee to wordpress can anyone tell me what i have to study or my task next. i have installed and upload wordpress i understand admin side and user side functionalite worked on dashboard understand folder structure and file structure of wordpress create a child theme of twenty.thirteen what's next move now
  12. What I am trying to do is extract the value of a variable from a hyperlink. The code that I have tried is as follows... #hyperlink creation <a href="<?php echo home_url(); ?>/title.php?title=<?php echo $args[$x]; ?>"><?php echo $args[$a]; ?></a> #value extract header(" echo home_url(); /" . $_GET ['title'] . ".php" ); $title = $_GET['title']; any help appreciated
  13. Hi, I'm having a real problem with one of my Wordpress category pages. I use a 3-column grid system on this page and just recently I needed to add an advert to the page, so I thought I would do one query at the top with the first two posts, then add the advert to complete the row. Then I would use a second query underneath creating the posts using the traditional grid system with 3 in each row. This is working well except for the pagination, which adds the two items form the first query everytime it paginates. You can see this in action at http://soundsandcolours.com/music/ Does anyone know what I can do to make the Pagination ignore the first query, and just keep running the second query instead. I've included all of my code below: 1st Query: $query_string; $musiccat_posts = new WP_Query($query_string."&posts_per_page=2"); if ($musiccat_posts->have_posts()): $musiccatIDs = array(); while($musiccat_posts->have_posts()):$musiccat_posts->the_post(); $musiccatIDs[] = get_the_ID(); 2nd Query: $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; global $moremusiccat_query; $music_args = array( 'cat' => 1841, 'posts_per_page' => 15, 'post__not_in' => $musiccatIDs, 'paged' => $paged ); $moremusiccat_query = new WP_Query( $music_args ); while ($moremusiccat_query -> have_posts()) : $moremusiccat_query -> the_post(); ?> Pagination Code: $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $moremusiccat_query->max_num_pages ) ); Any help would be massively appreciated!
  14. 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>'; }
  15. Hi, I'm a novice and have the below code in a Wordpress theme. I'm trying to get the form to submit automatically so it logs an entry into the MySql db as though the person clicked the heart icon (submit). Ideally I subsequently want to hide the heart icon so on load maybe after 3 seconds the entry is auto fired to the MySql DB. I have got as far as the manual click adding the entry, however can't get to to auto submit, any gel would be appreciated. Thank you in advance. ////PHP Form///// <form class="ajax-form" action="<?php echo AJAX_URL; ?>" method="POST"> <?php if(ThemexUser::islastviewed(ThemexUser::$data['active_user']['ID'])) { ?> <a href="#" title="<?php _e('Remove from lastviewed', 'lovestory'); ?>" data-title="<?php _e('Add to Last Viewed', 'lovestory'); ?>" class="icon-heart submit-button current"></a> <input type="hidden" class="toggle" name="user_action" value="remove_lastviewed" data-value="add_lastviewed" /> <?php } else { ?> <a href="#" title="<?php _e('Add to Last Viewed', 'lovestory'); ?>" data-title="<?php _e('Remove from Last Viewed', 'lovestory'); ?>" class="icon-heart submit-button"></a> <input type="hidden" class="toggle" name="user_action" value="add_lastviewed" data-value="remove_lastviewed" /> <?php } ?> <input type="hidden" name="user_lastviewed" value="<?php echo ThemexUser::$data['active_user']['ID']; ?>" /> <input type="hidden" class="nonce" value="<?php echo wp_create_nonce(THEMEX_PREFIX.'nonce'); ?>" /> <input type="hidden" class="action" value="<?php echo THEMEX_PREFIX; ?>update_user" /> </form> ////Ajax///// //Elements var themeElements = { ajaxForm: '.ajax-form', } //AJAX Form $(themeElements.ajaxForm).each(function() { var form=$(this); form.submit(function() { var message=form.find('.message'), loader=form.find('.loader'), toggle=form.find('.toggle'), button=form.find(themeElements.submitButton), title=form.find(themeElements.submitButton).data('title'); var data={ action: form.find('.action').val(), nonce: form.find('.nonce').val(), data: form.serialize() } loader.show(); button.addClass('disabled').toggleClass('current'); if(!message.hasClass('static')) { message.slideUp(300, function() { $(themeElements.colorboxLink).colorbox.resize(); }); } jQuery.post(form.attr('action'), data, function(response) { if(jQuery('.redirect', response).length) { if(jQuery('.redirect', response).attr('href')) { window.location.href=jQuery('.redirect',response).attr('href'); } else { window.location.reload(); } message.remove(); } if(title) { button.data('title', button.attr('title')); button.attr('title', title); } toggle.each(function() { var value=toggle.val(); toggle.val(toggle.data('value')); toggle.data('value', value); }); loader.hide(); button.removeClass('disabled'); if(response!='' && response!='0' && response!='-1') { if(message.hasClass('popup')) { $.colorbox({html:'<div class="popup">'+response+'</div>'}); } else if(message.hasClass('static')) { message.append(response); } else { message.html(response).slideDown(300, function() { $(themeElements.colorboxLink).colorbox.resize(); }); } } form.find('.temporary').val(''); form.find('.scroll').each(function() { $(this).scrollTop($(this)[0].scrollHeight); }); }); return false; }); }); Thank you
  16. Hi all, I'm running an update sql query from my wordpress functions file when a form is submitted. This grabs the address fields, uses the Google API and gets the lat and lng co-ords so I can utilise these elsehwere. My issue is the warning I get when I submit the form. My codes below: $meta_value = array( 'address' => $full_address, 'lat' => $lat, 'lng' => $lng ); #$location = array($full_address,$lat,$lng); print_r($meta_value); $wpdb->show_errors(); #$wpdb->update( $table, $data, $where ); $wpdb->update( $wpdb->postmeta, array( 'meta_value' => $meta_value ), array( "meta_key" => 'location', "post_id" => $post_id )); $wpdb->print_error(); var_dump( $wpdb->last_query ); However, when it runs, I get the warning: Warning: mysql_real_escape_string() expects parameter 1 to be string, It should pass in the values from the Array: Array ( [address] => Address 1, Town, County AB12 3CD, United kingdom [lat] => 50.123456 [lng] => 0.1234567 ) I can't see for looking now so any help is much appreciated!
  17. Hi, I am having a small issue with a front end html form, which through a series of looped input fields will update multiple WordPress posts at once, on submisson. The issue i'm having currently, is on submission it's only updating 1 post. I have found a solution to my problem, here: http://wordpress.stackexchange.com/questions/206372/how-to-handle-dynamic-form-data-with-repeating-fields But as i am still a bit of a novice, I have tried to apply the max_id solution to my code below, so far i've not got it to work. Using the solution on the above link, I don't suppose someone could show/tell me, what the code should be in it's entirety?? Including the foreach section, thanks! foreach( $testArray as $value ) { $post_information = array( 'post_title' => $value, 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. 'post_type' => 'predictions' //'post',page' or use a custom post type if you want to ); //update post wp_update_post($post_information);
  18. I wish to hire a php developer to design a imdb plugin that will slot into the way that I have designed my wordpress theme. Hope here from you soon Steven www.scottiescotsman.com
  19. Hello I have wordpress tube template, i want to remove video player in single page and want to use normal post insted, could anyone help me for that. my singlepage php code is <?php get_header(); ?> <div class="wrap grid rStatic player"> <div class="mainw"> <?php setPostViews(get_the_ID()); ?> <?php while ( have_posts() ) : the_post(); ?> <div class="main l200 r300"> <?php $player = get_option('mtn_player'); if ($player == "top") { include (TEMPLATEPATH . '/inc/layout/player2.php'); } elseif ($player == "bottom") { include (TEMPLATEPATH . '/inc/layout/player1.php'); } else { get_template_part( 'inc/layout/player1', get_post_format() ); } if(get_option('mtn_related_title')){ $title = get_option('mtn_related_title'); } else { $title = __('Video Suggestions', 'bestia'); } ?> </div> </div> <?php endwhile; // end of the loop. ?> <div class="main l200" id="suggestions"> <h2><?php echo $title; ?></h2> <?php include (TEMPLATEPATH . '/inc/related-videos.php'); echo '</div></div>'; ?> <div class="right300 rZone"><div class="holder"> <?php if (get_option('mtn_adsright') <> '') { echo stripslashes(get_option('mtn_adsright')); } else { } echo '</div></div>'; get_template_part( 'inc/sidebar/sidebar-video', get_post_format() ); echo '</div></div>'; get_footer(); ?>
  20. I'm trying to out put all Crelly Slider Alias's within Redux Framework Options in a Dropdown Select. I must confess i'm a novice at PHP ... I've attached the code from within Crelly Slider to show how it outputs the Alias names and i've also attached the Redux Code for the dropdown with an existing select .. I somehow need to output a list of all Crelly Alias's into 'options' => array( 'asc' => 'Ascending', 'desc' => 'Descending' ), Obviously replacing the exisiting options. Here is the full Crelly Output <?php global $wpdb; $sliders = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'crellyslider_sliders'); if(!$sliders) { echo '<div class="cs-no-sliders">'; _e('No Sliders found. Please add a new one.', 'crellyslider'); echo '</div>'; echo '<br /><br />'; } else { ?> <table class="cs-sliders-list cs-table"> <thead> <tr> <th colspan="5"><?php _e('Sliders List', 'crellyslider'); ?></th> </tr> </thead> <tbody> <tr class="cs-table-header"> <td><?php _e('ID', 'crellyslider'); ?></td> <td><?php _e('Name', 'crellyslider'); ?></td> <td><?php _e('Alias', 'crellyslider'); ?></td> <td><?php _e('Shortcode', 'crellyslider'); ?></td> <td><?php _e('Actions', 'crellyslider'); ?></td> </tr> <?php foreach($sliders as $slider) { echo '<tr>'; echo '<td>' . $slider->id . '</td>'; echo '<td><a href="?page=crellyslider&view=edit&id=' . $slider->id . '">' . $slider->name . '</a></td>'; echo '<td>' . $slider->alias . '</td>'; echo '<td>[crellyslider alias="' . $slider->alias . '"]</td>'; echo '<td> <a class="cs-edit-slider cs-button cs-button cs-is-success" href="?page=crellyslider&view=edit&id=' . $slider->id . '">' . __('Edit Slider', 'crellyslider') . '</a> <a class="cs-delete-slider cs-button cs-button cs-is-danger" href="javascript:void(0)" data-delete="' . $slider->id . '">' . __('Delete Slider', 'crellyslider') . '</a> </td>'; echo '</tr>'; } ?> </tbody> </table> <?php } ?> <br /> <a class="cs-button cs-is-primary cs-add-slider" href="?page=crellyslider&view=add"><?php _e('Add Slider', 'crellyslider'); ?></a> And my Redux Option array( 'id' => 'alias_select', 'type' => 'select', 'title' => __( 'Alias Select', 'ultra-web-admin' ), 'desc' => __( 'Select Slider Alias.', 'ultra-web-admin' ), 'options' => array( 'asc' => 'Ascending', 'desc' => 'Descending' ), 'default' => 'asc' ), I would be really grateful if anyone could assist me . Thank you !
  21. Hi all, PHP newbie here. I've been trying to integrate Gravity Forms with Gravity View's Import Entries from CSV plugin. Unfortunately, it needs a bit of tweaking to get everything connected properly. I used a code snippet from David at Gravity Whiz, (HERE) that gets integrated into my Wordpress site's functions.php file, and have been trying to customize to to suit my needs. From what I understand in looking at the code, the only bit I need to tweak (I think) is the bottom portion: # Configuration new GW_Value_Exists_Validation( array( 'target_form_id' => 1, 'target_field_id' => 3, 'source_form_id' => '/RSVPcodes.csv', 'source_field_id' => 'rsvp', 'validation_message' => 'Hey! Don\'t be a villain! Provide a legit RSVP code to reserve your spot at the Smackdown.' ) ); My main question here: how to get the validation code to see the database that I've uploaded via the Import Entries plugin? I know ignorance is making me miss something that should be pretty simple. Right now, I've got it to validate a test word that I know is not in my database, and also a code that I know is in the database. It's coming back with both items as not valid. The end result will be a RSVP form that will be used to accept RSVPs only from people who have an RSVP code from their invitation, a lot like a license key validation system. The live site (and form I'm trying to tweak) is HERE. Thanks in advance for any help.
  22. Hi dear php coders! ]'m almost new in php and now i'm dealing with wordpress . ] want to get a long string from database with get_post_meta function. (and aftar that i wanna Parse this string and Play with that ...! ) how can i do that ?? i don't know what arguments i must pass to the function ... any help would be appreciated. thanks in advance.
  23. Hi experts! I am not a programmer, just a designer and I have problems with php codes, I would like to display a bundle of Wordpress shortcode below on my website but I unable to make it correct, please help me. <?php if ( is_single() ) { echo "<div class="pagelink"><?php wp_link_pages('pagelink=trang %'); ?></div><p>" echo "<div class="fb-like" data-href="https://www.facebook.com/tvvn.net" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div><p>" <?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings($pid); endif; ?><p> <?php echo do_shortcode("[kpvc_single]"); ?><p> <?php echo do_shortcode("[fbcomments]"); ?><p> <?php zemanta_related_posts()?> } else {} ?> Each part of the code is correct because it came from the plugin, but I don't known how to make it display at the same place. Could you please help complete Echo etc... the code above. Thanks very much! TOM
  24. Hello i am working with woocommerce where i have products displayed on shop page now i want that user can purchase product only once. So i am trying to get the orders of user and trying to redirect to the user to my account page so i am using following code in functions.php <?php $user_id = get_current_user_id(); $current_user= wp_get_current_user(); $customer_email = $current_user->email; $args = array( 'post_type' => 'product', 'posts_per_page' => 12 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() and is_page( 1036 )) { echo "has post"; } else { echo do_shortcode('[ recent_products per_page=20" columns="4" orderby="rand" order="rand]'); } ?> but its not working anyone can help.
  25. I am new in php programming and I have develop php script using TCPDF libary that takes data from pdf form fields and create flatten copy of that PDF using TCPDF , after that I use "AttachMailer.php" to send copies of PDF to client and customer, when user fill pdf form and click submit button flatten copy of that pdf is created in wp-content/uploads/pdf folder , and email code gets same copy fro wp-content/uploads/pdf folder and copy is forwarded to client and customer once copies are forwarded, it should show message "email has been sent.....email-address". // =============Email Form=============================== require_once(dirname(__FILE__)."/AttachMailer.php"); $mailer = new AttachMailer($Email, $Email, "Submitted Form Copy", "hello <b>Please Find the Attached Copy of form sumitted</b>"); $mailer->attachFile($fpath.$Contact_Name.'_'.$Email.$fID); $mailer1 = new AttachMailer($Email,$CEmail, "CC for client Submitted Form ", "hello <b>Please Find the Attached Copy of form sumitted by </b>".$Contact_Name); $mailer1->attachFile($fpath.$Contact_Name.'_'.$Email.$fID); if($mailer->send()) { echo "Email has been sent to ".$Email."\n and" ; } else{ echo "error in email\n"; exit(); } if($mailer1->send()){ echo "\nCC has been sent to ".$CEmail ; } else{echo "\nerror in email CC was not sent to ".$CEmail;}! the problem is that when user click submit button he/or she is redirected to home page (which i dont want)with executing if and else statements in email code shown above please help me how can I stop redirecting to home page. you can see screenshot of redirected page from my dropbox https://www.dropbox.com/s/t48rqemujn21q42/redirectpagescreenshot.png?dl=0
  • 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.