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. Hello Everyone I've installed wordpress already for a sex education website. I need to show a warning page before a visitor can proceed to the main website. I was wondering if there's a plugin that I can install for wordpress that shows a warning message/page before someone can entre the main website. If not, is this my best choice to create a custome HTML page, add the put the wanring text needed, then place two links for I agree & I don't agree , for example? but in this case, I have to move the wordress installation to another location right? thank you so much
  2. Hi there I have the following page, which includes a php mail function and sends a few of the fields via email successfully. Once the form is submitted, another page is displayed called 'Thank you'. (?page_id=2561) Question 1: Is there a way to reference all of the fields from the html tables at once in the php script (to email all the fields) or is it necessary to call each fields as I have done with 'companyName' etc? Question 2: How would I include all of the fields 'submitted contents' to display on the 'Thank you' page (?page_id=2561) - as I would like to add a 'print to pdf' button on this page, whereby the user can print the submitted form contents. I would greatly appreciate any advice / direction :) Thank you so much <?php { //send email $email = $_REQUEST['email'] ; $confName = $_REQUEST['conferenceName'] ; $companyName = $_REQUEST['companyName'] ; mail("myemail@yahoo.com", $confName, $companyName, "From:" . $email); } ?> <form method="post" id="quote" action="?page_id=2561"> <script type="text/javascript">// <![CDATA[ jQuery('#quote').keyup(function (){ doTotal(this); calcMenu(this); }); // ]]></script> <table id="table1" border="0" cellspacing="3" cellpadding="3"> <tbody> <tr> <td>Enquiry Date</td> <td> <div align="center"><input type="text" name="dateToday" size="25" /></div></td> </tr> <tr> <td>Conference Name</td> <td> <div align="center"><input type="text" name="conferenceName" size="25" /></div></td> </tr> <tr> <td>Company Name</td> <td> <div align="center"><input type="text" name="companyName" size="25" /></div></td> </tr> <tr> <td>Special Requests</td> <td><textarea name="comment" rows="5" cols="26"></textarea></td> </tr> </tbody> </table> <table id="table2" border="0" cellspacing="3" cellpadding="3"> <tbody> <tr> <td>First Name</td> <td> <div align="center"><input type="text" name="firstName" size="25" /></div></td> </tr> <tr> <td>Last Name</td> <td> <div align="center"><input type="text" name="lastName" size="25" /></div></td> </tr> <tr> <td>Tel No</td> <td> <div align="center"><input type="text" name="telNo" size="25" /></div></td> </tr> <tr> <td>Cell</td> <td> <div align="center"><input type="text" name="cellNo" size="25" /></div></td> </tr> <tr> <td>Email</td> <td> <div align="center"><input type="text" name="email" size="25" /></div></td> </tr> <tr> <td><input onclick="formReset()" type="button" value="Reset form" /></td> </tr> <tr> <td><input type='submit'></td> </tr> </tbody> </table> <table id="tablex" border="1" cellspacing="3" cellpadding="3"> <tbody> <tr> <th scope="col" width="30"> <div align="center">Date</div></th> <th scope="col" width="128"> <div align="center">Amount of Delegates ½ Day Conference @ R 240 pp</div></th> <th width="112"> <div align="center">Amount of Delegates Full Day Conference @ R 260 pp</div></th> <th width="112"> <div align="center">Menu No</div></th> <th width="112"> <div align="center">Price pp for Menu (1-7: R70, 8-10 R85, 11: R105, 12: R85)</div></th> <th width="112"> <div align="center">Total Persons for meals</div></th> <th width="112"> <div align="center">Amount of Single Rooms @ R 480 pp</div></th> <th width="112"> <div align="center">Amount of Double Rooms @ R 720 pp</div></th> <th width="134"> <div align="center">Total for the day</div></th> </tr> <tr> <td> <div align="center"><input type="text" name="date1" size="10" /></div></td> <td> <div align="center"><input type="text" name="halfday1" size="5" maxlength="10" /></div></td> <td> <div align="center"><input type="text" name="fullday1" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuNo1" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuPrice1" size="5" /></div></td> <td> <div align="center"><input type="text" name="MealPersons1" size="5" /></div></td> <td> <div align="center"><input type="text" name="SingleRooms1" size="5" /></div></td> <td> <div align="center"><input type="text" name="DoubleRooms1" size="5" /></div></td> <td> <div align="center"><input type="text" name="total1" size="5" /></div></td> </tr> <tr> <td> <div align="center"><input type="text" name="date2" size="10" /></div></td> <td> <div align="center"><input type="text" name="halfday2" size="5" /></div></td> <td> <div align="center"><input type="text" name="fullday2" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuNo2" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuPrice2" size="5" /></div></td> <td> <div align="center"><input type="text" name="MealPersons2" size="5" /></div></td> <td> <div align="center"><input type="text" name="SingleRooms2" size="5" /></div></td> <td> <div align="center"><input type="text" name="DoubleRooms2" size="5" /></div></td> <td> <div align="center"><input type="text" name="total2" size="5" /></div></td> </tr> <tr> <td> <div align="center"><input type="text" name="date3" size="10" /></div></td> <td> <div align="center"><input type="text" name="halfday3" size="5" /></div></td> <td> <div align="center"><input type="text" name="fullday3" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuNo3" size="5" /></div></td> <td> <div align="center"><input type="text" name="MenuPrice3" size="5" /></div></td> <td> <div align="center"><input type="text" name="MealPersons3" size="5" /></div></td> <td> <div align="center"><input type="text" name="SingleRooms3" size="5" /></div></td> <td> <div align="center"><input type="text" name="DoubleRooms3" size="5" /></div></td> <td> <div align="center"><input type="text" name="total3" size="5" /></div></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> </table> </form>
  3. Hi there I am trying to use the php mail function, but I am receiving this error: The requested URL /mailform.php was not found on this server. PHP <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("myemail@yahoo.com", $subject, $message, "From:" . $email); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text'><br> Subject: <input name='subject' type='text'><br> Message:<br> <textarea name='message' rows='15' cols='40'> </textarea><br> <input type='submit'> </form>"; } ?> ( I replaced my email address with "myemail@yahoo.com" just for the forum... Thank you
  4. Hi I put the following code into my functions.php file. Here's what I want: 1. I want the cookie to be set only when the visitor goes to Post 1. 2. When someone visits Post 2, if they have the cookie, they get redirected to Post 3. If they don't have the cookie, nothing happens. Now it seems to be working, but the problem is sometimes, when the cookie isn't set, I get redirected to Page 3 from the home page :s. I have no idea why. I should mention I know nothing about coding. The code below is stuff I got online, mixed and matched it, and did some trial and error with my blog. function set_newuser_cookie() { $currentURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //THE ABOVE GETS THE CURRENT URL if (!isset($_COOKIE['subscriber']) && $currentURL == 'http://mysite.com/post1') { setcookie('subscriber', no, 0, COOKIEPATH, COOKIE_DOMAIN, false); //THE ABOVE SETS A COOKIE IF IT FINDS THE CURRENT URL IS /POST1 } } add_action( 'init', 'set_newuser_cookie'); //I DON'T KNOW WHAT THE ABOVE IS, BUT I HEAR IT'S IMPORTANT $currentURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //THE ABOVE GETS THE URL AGAIN if ( isset( $_COOKIE["subscriber"] ) && $currentURL == 'http://mysite.com/post2' ) : header( "Location: http://mysite.com/post3" ); endif; //THE ABOVE REDIRECTS THE VISITOR TO POST3 ON 2 CONDITIONS: 1. THAT THE COOKIE IS SET, 2. THAT THE CURRENT URL IS /POST2 Please help!
  5. I hope this is the right place to post this. I have wordpress installed on one domain (iaddicshelters.net) AND I have another non-wordpress application on a second domain (iaddic.info). The first is a self hosted wordpress and the second is a windows server running a particular application. To execute the application on the non-wordpress domain (iaddic.info) I enter a url like this: http://iaddic.info/webs/cis/config/Configurator.aspx?cid=c06b50fe-e087-40b0-8434-d763fabd1515&mid=c06b50fe-e087-40b0-8434-d763fabd1515&src=C The cid= is used as the filename of the result of executing the application and the mid is a specific configuration that is being run. The cid captures the result of running the mid configuration... That said: I can not just place a link to the url because every user would essentially store the information in the same file (the cid). I want to prepend the cid with the currently logged in user and date and time. Lets say John Harris (a made up username) is the logged in user and John is about to run the application on the iaddic.info domain; I would like the cid to now read: http://iaddic.info/webs/cis/config/Configurator.aspx?cid=username-timestamp-c06b50fe-e087-40b0-8434-d763fabd1515&mid=c06b50fe-e087-40b0-8434-d763fabd1515&src=C Does anyone know how to insert this information into the url so that when John depresses a "launch aplication" button the url will of the cid is prepended? In some regards this could be looked at as a concatenation of the base url the username the timestamp and the cid and mid string. Doing this will also allow John to copy this url at a later date and retrieve the results of that particular session thatcontains his username and timestamp. I am really stuck here and your help is most appreciated...thank you
  6. Hello, I have been trying to figure out how to write a certain php query and for the life of me I can not figure it out. I've tried searching on google like a mad man and still can not figure it out. Maybe Im missing something, Im not sure. I came across this site while googlin for answers. The php code is for a wordpress site I am working on. Here is my current code - <?php $custom_terms = get_terms('videoscategory'); $other_custom_terms = get_terms('product_category'); foreach(array($custom_terms as $custom_term) { wp_reset_query(); $args = array('post_type' => 'product', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'videoscategory', 'field' => 'slug', 'terms' => $custom_term->slug ), array( 'taxonomy' => 'product_category', 'field' => 'slug', 'terms' => $other_custom_term->slug ), ) ); $loop = new WP_Query($args); if($loop->have_posts()) { echo '<h1 style="margin-top:10px;">'.$custom_term->name.'</h1>'; while($loop->have_posts()) : $loop->the_post(); echo '<h2><a href="'.get_permalink().'">'.get_the_title().'</a></h2>'; endwhile; } } ?> Im trying to list all the posts that are in both of my custom taxonomies, however when I try using the code nothing shows but when I use 1 taxonomy at a time, with one array, it works perfectly. Someone on gave me some advice but I do not understand it - generate array of your second taxonomy terms and feed it into the query - What exactly is that advice telling me to do? Any help is appreciated. Thanks.
  7. Hello everyone, This is very weird, I have installed a theme, modified it, and it was working great, after a while, the theme started appearing in the admin area please check screenshot to see what I mean I don't know what caused this or how to fix it any help?
  8. Hi, I'm having a problem ever since I switched hosting servers. My contact page form and other email forms aren't working on the server. This is what suport emailed me: Mar 24 19:59:26 hercules suhosin[30188]: ALERT - mail() - To: headers aren't allowed in the headers parameter. (attacker '99.108.165.151', file > '/home/manilade/public_html/wp-includes/class-phpmailer.php', line 769) Mar 24 20:00:19 hercules suhosin[5929]: ALERT - mail() - To: headers aren't allowed in the headers parameter. (attacker '99.108.165.151', file '/home/manilade/public_html/wp-includes/class-phpmailer.php', line 769) When I deleted 769, I got 2 errors. 1. Undefined variable line 771: $isSent = ($rt == 1) ? 1 : 0; 2. Undefined variable line 778: if(!$rt) { Does anyone know how to fix this? thanks.
  9. Helo, I am using the adapt theme from wp explorer. I recently configured properly the theme. After several tweakings for some reason when I hover the the dropdown menu above the slider (flexslider) and then try to click a sub menu it wont click instead its disappearing. I already tried to remove the slider and then try it again but still getting the same output. (Picture ->http://cfsmplus.com/prob.JPG) I'm really having a hard time figuring this is out. I dont know if this all about the jquery or what. Please help. Thanks.
  10. Hi, I am building an RSS Aggregator plugin for my Wordpress Installation. One of the feeds I am using is: https://news.google.co.uk/news/feeds?pz=1&cf=all&ned=uk&hl=en&cf=all&as_qdr=w&output=rss&q As you can see this feeds content is a table of data including news headline, excerpt and a tiny thumbnail image. How is it possible for me to extract the actual full article text and the large Image from the <link> tag of the RSS item or does it look like I have the wrong news feed? Thanks for advice with this.
  11. Visual instruction: http://bit.ly/14JyZAz The theme is here : http://demo.wpzoom.com/?theme=meeta I want to remove the title of the site from appearing at the header. But at the same time not removing the title of the site from showing when searching on google or appearing as the name of the tab. I am a complete newbie and would appreciate the help very much, my friends.
  12. Hi, I am a complete newbie when comes to coding. I'd appreciate very much the help. There's this WordPress plugin where you cloak your links (the plugin here --> http://bit.ly/13AYpUF). It redirects the link using this model: websitename.com/go/username I want the name in the link instead of "go" to be "list" -- like this : websitename.com/list/username (p.s. instead of the name "list" I may choose a different one.) I tried myself to replace within the code the name "go" with "list", but after doing this, when clicking the link it showed a 404 error page. Thank you VERY much!
  13. Wordpress Templates problem I have custom post types but when I try and view the pages it just defaults http://d698815.eechost.com This is a custom post type called Polish but its just defaulting to the homepage http://d698815.eechost.com/polish/hh/ Any ideas?
  14. Hello, This is my first post on the forum and I'm super glad that I found it! hopefully you can help me. I am trying to edit a wordpress plugin (https://github.com/samsonw/wp-grid-archives). It is an archive plugin that displays post title and excerpt sorted by date. I want to get it to display the post thumbnail or featured image. I posted the code I think i need to be changing at the bottom. I tried various things like placing <?php the_post_thumbnail( $size, $attr ); ?> But I can't work it out. Thank you very much for any help. It will be greatly appreciated! Luke define('GRID_ARCHIVES_VERSION', '1.6.0'); /** * Guess the wp-content and plugin urls/paths */ // Pre-2.6 compatibility if ( ! defined( 'WP_CONTENT_URL' ) ) define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); if ( ! defined( 'WP_CONTENT_DIR' ) ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); if ( ! defined( 'WP_PLUGIN_URL' ) ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' ); if ( ! defined( 'WP_PLUGIN_DIR' ) ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); define('GRID_ARCHIVES_POSTS_TRANSIENT_KEY', 'grid_archives_posts'); define('GRID_ARCHIVES_OPTION_NAME', 'grid_archives_options'); if (!class_exists("GridArchives")) { class GridArchives { var $options; var $style; function GridArchives() { $this->plugin_url = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)); add_action('wp_print_styles', array(&$this, 'load_styles')); add_action('admin_print_scripts', array(&$this, 'load_admin_scripts')); add_action('wp_print_footer_scripts', array(&$this, 'load_scripts')); add_shortcode('grid_archives', array(&$this, 'display_archives')); // admin menu add_action('admin_menu', array(&$this, 'grid_archives_settings')); // invalidate cache add_action('save_post', array(&$this, 'delete_cache')); add_action('edit_post', array(&$this, 'delete_cache')); add_action('delete_post', array(&$this, 'delete_cache')); register_activation_hook(__FILE__, array(&$this, 'install')); } // Grab all posts and filter them into an array private function get_posts($category) { // If we have a non-expire cached copy of the filtered posts array, use that instead if($posts = get_transient(GRID_ARCHIVES_POSTS_TRANSIENT_KEY)) { return $posts; } $category_id = get_cat_ID($category); // Get a simple array of all posts under category $category_id $rawposts = get_posts(array('numberposts' => -1, 'category' => $category_id, 'order' => $this->options['sort_direction'])); // Trim some memory foreach ( $rawposts as $key => $rawpost ) $rawposts[$key]->post_content = $this->get_excerpt($rawposts[$key]->post_content, $this->options['post_content_max_len']); // Loop through each post and sort it into a structured array foreach( $rawposts as $key => $post ) { $posts[ mysql2date('Y', $post->post_date) ][ mysql2date('Y.m', $post->post_date) ][] = $post; $rawposts[$key] = null; } $rawposts = null; // More memory cleanup if($posts === null) { $posts = array(); } // Store the results into the WordPress transient, expires in 1 day (24 hours) set_transient(GRID_ARCHIVES_POSTS_TRANSIENT_KEY, $posts, 60*60*24); return $posts; } private function get_date_format($attr) { if($attr['month_date_format'] === 'default'){ $month_date_format = $this->options['month_date_format']; if($month_date_format === 'custom'){ $month_date_format = $this->options['month_date_format_custom']; } }else{ $month_date_format = $attr['month_date_format']; } if($attr['post_date_format'] === 'default'){ $post_date_format = $this->options['post_date_format']; if($post_date_format === 'custom'){ $post_date_format = $this->options['post_date_format_custom']; } }else{ $post_date_format = $attr['post_date_format']; } return array($month_date_format, $post_date_format); } private function compose_html_classic($posts, $monthly_summaries, $attr) { list($month_date_format, $post_date_format) = $this->get_date_format($attr); $html = '<div id="grid_archives" class="grid_archives_column">' . '<ul>'; foreach ($posts as $post_year => $yearly_posts) { foreach ($yearly_posts as $yearmonth => $monthly_posts) { list($year, $month) = explode('.', $yearmonth); $html .= '<li class="ga_year_month">' . '<a href="' . get_month_link( $year, $month ) . '" title="Monthly Archives: ' . $yearmonth . '">'. mysql2date($month_date_format, date('Y-m-d H:i:s', strtotime($year . '-' . $month))) . '</a>'; if(!empty($monthly_summaries[$yearmonth])){ $html .= '<span class="ga_monthly_summary">“' . $monthly_summaries[$yearmonth] . '”'; }else { $html .= '<span class="ga_monthly_summary">' . $this->options['default_monthly_summary']; } $html .= '</span></li>'; foreach ($monthly_posts as $post) { $html .= '<li class="ga_post">' . '<div class="ga_post_main">' . '<a href="' . get_permalink( $post->ID ) . '" title="' . $post->post_title . '">' . $this->get_excerpt($post->post_title, $this->options['post_title_max_len']) . '</a>' . '<p>' . $post->post_content . '</p>' . '</div>'; if(!$this->options['post_date_not_display']){ $html .= '<p class="ga_post_date">' . mysql2date($post_date_format, $post->post_date) . '</p>'; } $html .= '</li>'; } } } $html .= '</ul>' . '</div>'; return $html; } private function compose_html_compact($posts, $monthly_summaries, $attr) { list($month_date_format, $post_date_format) = $this->get_date_format($attr); $compact_month_list_date_format = $this->options['compact_month_list_date_format']; if($compact_month_list_date_format === 'custom'){ $compact_month_list_date_format = $this->options['compact_month_list_date_format_custom']; } $html = '<div id="grid_archives" class="grid_archives_column">'; $html .= '<ul class="ga_year_list">'; foreach ($posts as $year => $yearly_posts) { $html .= '<li><a href="' . get_year_link($year) . '" title="Archives of Year ' . $year . '">' . $year . '</a></li>'; } $html .= '</ul>'; foreach ($posts as $post_year => $yearly_posts) { $html .= '<div class="ga_pane">'; if(!$this->options['compact_hide_month_list']){ $html .= '<ul class="ga_month_list">'; $month_numbers = $this->get_months('numeric'); $month_range = $this->options['sort_direction'] === 'desc' ? range( 12, 1 ) : range( 1, 12 ); foreach ( $month_range as $i ) { $month_name = mysql2date($compact_month_list_date_format, date('Y-m-d H:i:s', strtotime($post_year . '-' . $month_numbers[$i]))); $month_post_count = count($yearly_posts[$post_year . '.' . $month_numbers[$i]]); if ($month_post_count > 0) { $html .= '<li class="ga_active_month"><a href="#' . $post_year . '_' . $month_numbers[$i] . '" title="' . $month_post_count . ' ' . ($month_post_count === 1 ? 'post' : 'posts') . '">' . $month_name . '</a></li>'; }else { $html .= '<li><span title="No post">' . $month_name . '</span></li>'; } } $html .= '</ul>'; } $html .= '<ul>'; foreach ($yearly_posts as $yearmonth => $monthly_posts) { list($year, $month) = explode('.', $yearmonth); $html .= '<li id="' . $year . '_' . $month . '" class="ga_year_month">' . '<a href="' . get_month_link( $year, $month ) . '" title="Monthly Archives: ' . $yearmonth . '">'. mysql2date($month_date_format, date('Y-m-d H:i:s', strtotime($year . '-' . $month))) . '</a>'; if(!empty($monthly_summaries[$yearmonth])){ $html .= '<span class="ga_monthly_summary">“' . $monthly_summaries[$yearmonth] . '”'; }else { $html .= '<span class="ga_monthly_summary">' . $this->options['default_monthly_summary']; } $html .= '</span></li>'; foreach ($monthly_posts as $post) { $html .= '<li class="ga_post">' . '<div class="ga_post_main">' . '<a href="' . get_permalink( $post->ID ) . '" title="' . $post->post_title . '">' . $this->get_excerpt($post->post_title, $this->options['post_title_max_len']) . '</a>' . '<p>' . $post->post_content . '</p>' . '</div>'; if(!$this->options['post_date_not_display']){ $html .= '<p class="ga_post_date">' . mysql2date($post_date_format, $post->post_date) . '</p>'; } $html .= '</li>'; } } $html .= '</ul></div>'; } $html .= '</div>'; return $html; } private function get_months( $format = 'long' ) { global $wp_locale; $months = array(); foreach ( range( 1, 12 ) as $i ) { if ( 'numeric' == $format ) { $months[$i] = zeroise( $i, 2 ); continue; } $month = $wp_locale->get_month( $i ); if ( 'short' == $format ) { $month = $wp_locale->get_month_abbrev( $month ); } $months[$i] = esc_html( $month ); } return $months; } private function get_excerpt($text, $length = 90) { if (!$length || mb_strlen($text, 'utf8') <= $length) return $text; $text = strip_tags($text); $text = preg_replace('/\(\(([^\)]*?)\)\)/', '(${1})', $text); $text = preg_replace('|\[(.+?)\](.+?\[/\\1\])?|s', '', $text); $text = mb_substr($text, 0, $length, 'utf8') . " ..."; return $text; } private function parse_summaries($str) { $summaries = array(); foreach (explode("\n", trim($str)) as $line) { if(strpos($line, '##') !== FALSE){ list($yearmonth, $summary) = array_map('trim', explode("##", $line, 2)); if (!empty($yearmonth)){ $summaries[$yearmonth] = stripslashes($summary); } } } return $summaries; } private function get_options() { $options = array('style_format' => 'classic', 'compact_hide_month_list' => false, 'compact_month_list_date_format' => 'F', 'compact_month_list_date_format_custom' => 'F', 'sort_direction' => 'desc', 'post_title_max_len' => 60, 'post_content_max_len' => 90, 'post_date_not_display' => false, 'post_date_format' => 'j M Y', 'post_date_format_custom' => 'j M Y', 'month_date_format' => 'Y.m', 'month_date_format_custom' => 'Y.m', 'post_hovered_highlight' => true, 'monthly_summary_hovered_rotate' => true, 'custom_css_styles' => '', 'load_resources_only_in_grid_archives_page' => false, 'grid_archives_page_names' => 'archives, grid-archives', 'default_monthly_summary' => '“... ...”', 'monthly_summaries' => "2010.09##It was AWESOME!\n2010.08##Anyone who has never made a mistake has never tried anything new."); $saved_options = get_option(GRID_ARCHIVES_OPTION_NAME); if (!empty($saved_options)) { foreach ($saved_options as $key => $option) $options[$key] = $option; } if ($saved_options != $options) { update_option(GRID_ARCHIVES_OPTION_NAME, $options); } return $options; } function handle_grid_archives_settings() { if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } $options = $this->get_options(); if (isset($_POST['submit'])) { check_admin_referer('grid-archives-nonce'); $orig_options = $options; $options = array(); $options['style_format'] = $_POST['style_format']; $options['compact_hide_month_list'] = isset($_POST['compact_hide_month_list']) ? (boolean)$_POST['compact_hide_month_list'] : false; $options['compact_month_list_date_format'] = $_POST['compact_month_list_date_format']; $options['compact_month_list_date_format_custom'] = stripslashes($_POST['compact_month_list_date_format_custom']); $options['sort_direction'] = $_POST['sort_direction']; $options['post_title_max_len'] = (int)$_POST['post_title_max_len']; $options['post_content_max_len'] = (int)$_POST['post_content_max_len']; $options['post_date_not_display'] = isset($_POST['post_date_not_display']) ? (boolean)$_POST['post_date_not_display'] : false; $options['post_date_format'] = $_POST['post_date_format']; $options['post_date_format_custom'] = stripslashes($_POST['post_date_format_custom']); $options['month_date_format'] = $_POST['month_date_format']; $options['month_date_format_custom'] = stripslashes($_POST['month_date_format_custom']); $options['post_hovered_highlight'] = isset($_POST['post_hovered_highlight']) ? (boolean)$_POST['post_hovered_highlight'] : false; $options['monthly_summary_hovered_rotate'] = isset($_POST['monthly_summary_hovered_rotate']) ? (boolean)$_POST['monthly_summary_hovered_rotate'] : false; $options['load_resources_only_in_grid_archives_page'] = isset($_POST['load_resources_only_in_grid_archives_page']) ? (boolean)$_POST['load_resources_only_in_grid_archives_page'] : false; $options['grid_archives_page_names'] = $options['load_resources_only_in_grid_archives_page'] ? stripslashes($_POST['grid_archives_page_names']) : $orig_options['grid_archives_page_names']; $options['custom_css_styles'] = stripslashes($_POST['custom_css_styles']); $options['default_monthly_summary'] = htmlspecialchars(stripslashes($_POST['default_monthly_summary'])); $options['monthly_summaries'] = htmlspecialchars(stripslashes($_POST['monthly_summaries'])); update_option(GRID_ARCHIVES_OPTION_NAME, $options); $this->delete_cache(); echo '<div class="updated" id="message"><p>Settings saved.</p></div>'; } include_once("grid-archives-options.php"); } private function get_style_format($style){ switch ($style) { case 'classic': case 'compact': break; case 'default': default: $style = $this->options['style_format']; break; } return $style; } function display_archives($atts){ extract( shortcode_atts( array( 'category' => 'General', 'style' => 'default', 'month_date_format' => 'default', 'post_date_format' => 'default' ), $atts ) ); $this->style = $this->get_style_format($style); $posts = $this->get_posts($category); $monthly_summaries = $this->parse_summaries($this->options['monthly_summaries']); return call_user_func(array($this, 'compose_html_' . $this->style), $posts, $monthly_summaries, array('month_date_format' => $month_date_format, 'post_date_format' => $post_date_format)); } function grid_archives_settings() { add_options_page('Grid Archives Settings', 'Grid Archives', 'manage_options', 'grid-archives-settings', array(&$this, 'handle_grid_archives_settings')); } private function load_extra_resources(){ if($this->options['load_resources_only_in_grid_archives_page']){ $load_extra = false; // if enabled, only load resources file (css, js etc) in those specific files foreach(array_map('trim', explode(",", $this->options['grid_archives_page_names'])) as $page_name){ $load_extra = is_page($page_name); if($load_extra) break; } }else{ // disabled, load $load_extra = true; } return $load_extra; } function load_styles(){ $this->options = $this->get_options(); if($this->load_extra_resources()){ $css_url = $this->plugin_url . '/grid-archives.css'; wp_register_style('grid_archives', $css_url, array(), GRID_ARCHIVES_VERSION, 'screen'); wp_enqueue_style('grid_archives'); if($this->options['post_hovered_highlight'] || $this->options['monthly_summary_hovered_rotate']) { $effect_css_url = $this->plugin_url . '/grid-archives-effect-css.php'; wp_register_style('grid_archives_effect', $effect_css_url, array(), GRID_ARCHIVES_VERSION, 'screen'); wp_enqueue_style('grid_archives_effect'); } $custom_css_styles = trim($this->options['custom_css_styles']); if(!empty($custom_css_styles)) { $custom_css_url = $this->plugin_url . '/grid-archives-custom-css.php'; wp_register_style('grid_archives_custom', $custom_css_url, array(), GRID_ARCHIVES_VERSION, 'screen'); wp_enqueue_style('grid_archives_custom'); } } } function load_scripts(){ if($this->load_extra_resources() && 'compact' === $this->style){ $jquery_tools_url = $this->plugin_url . '/jquery.tools.tabs.min.js'; wp_register_script('jquery.tools', $jquery_tools_url, 'jquery' , '1.2.5'); $js_url = $this->plugin_url . '/grid-archives.js'; wp_register_script('grid_archives', $js_url, array('jquery', 'jquery.tools') , GRID_ARCHIVES_VERSION); wp_print_scripts('grid_archives'); } } function load_admin_scripts(){ $admin_script_url = $this->plugin_url . '/grid-archives-options.js'; wp_register_script('grid_archives_admin_script', $admin_script_url, 'jquery', GRID_ARCHIVES_VERSION); wp_enqueue_script('grid_archives_admin_script'); } function delete_cache() { delete_transient(GRID_ARCHIVES_POSTS_TRANSIENT_KEY); } function install() { $this->options = $this->get_options(); } } } if (class_exists("GridArchives")) { $grid_archives = new GridArchives(); } ?>
  15. Hi I have a Wordpress setup and theme running nicely. I want to add a shop and Woocommerce has been recommended as the right way to go, so I've installed that nice and easy, but it doesn't work with my theme. I found this, http://wcdocs.woothemes.com/codex/third ... atibility/ I am trying to implement the hook. But I'm struggling as I find the instructions unclear. I'm sure this doesn't need any past knowledge of Woocommerce just of php. I've added the following to line 31 of the function.php file add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10); add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { echo '<section id="maincontent">'; } function my_theme_wrapper_end() { echo '</section>'; } which to be honest is just area of the function.php with a gap. I've copied the function.php content into a Word doc linked to below. http://www.smarterbarcodes.co.uk/phpcontent.docx Any help on this would be great, Woo won't help until you have bought additional extensions, but if I can't get it to work, why should I?
  16. Hey everyone! So I have this code for wordpress that takes the featured image of a all the posts and displays the image and post title on one page. Then said image and post title links to that specific post. I'm very happy with how it functions right now, the only thing that I don't like right now is that it stacks above one another and I would like it to display in rows. Here is an example of it right now: http://blog-kora.marathonwebsites.com/ and here is my code: <?php global $post; $myposts = get_posts (); foreach( $myposts as $post ) : setup_postdata($post); ?> <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('feat_image');?></a> <?php endforeach; ?> could anyone add code to my (preferably) php to help add columns? I really need help with it and I have no clue what to do
  17. I'm new to the site here, so I hope this is the right place for this post. It's also from a Wordpress site, but since Wordpress isn't the issue (and my [lack of] programming knowledge is), I figured this wouldn't fit on the Wordpress forums very well. So here's my problem. I downloaded a plugin which I'm trying to modify, and it's breaking my site (internal server error), which always makes for a fun day. Here's the piece I'm inserting: // ---START--- Add Buddypress 'Friends' filter. $wpdb->show_errors(); $k_user_id = $current_user->ID; $k_friends1 = $wpdb->get_col( "SELECT initiator_user_id FROM $wpdb->prefix . 'bp_friends' WHERE friends_user_id = $k_user_id AND is_confirmed = 1" ); $k_friends2 = $wpdb->get_col( "SELECT friends_user_id FROM $wpdb->prefix . 'bp_friends' WHERE initiator_user_id = $k_user_id AND is_confirmed = 1" ); $k_friends = array($k_friends1, $k_friends2); foreach($workers as $x) { if(!in_array($x, $k_friends, TRUE) { unset($workers[$x]); } } $wpdb->hide_errors(); The plugin has already defined the $workers variable, but I'd like to modify that variable by removing any values not contained in either of the two SQL queries. To provide more context, this plugin is an appointments plugin that I'm trying to integrate with Buddypress so that users can schedule appointments with each other, but only if they're friends. I know just enough php to get myself in trouble, so I'm sure there's something that's very obvious to everyone else, but I'm not seeing it...and it's very likely to do with me not understanding exactly how the functions are actually working. Any help would be very much appreciated. Thanks!
  18. Hi everyone, I would like to edit a file so that it only shows a image iif it is the home page on wordpress. <?php /* WARNING: This file is part of the core Genesis framework. DO NOT edit this file under any circumstances. Please do all modifications in the form of a child theme. */ /** * Handles the footer structure. * * This file is a core Genesis file and should not be edited. * * @category Genesis * @package Templates * @author StudioPress * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) * @link http://www.studiopress.com/themes/genesis */ genesis_structural_wrap( 'inner', '</div><!-- end .wrap -->' ); echo '</div><div class="quote-table"><img src="http://clients2.weblink.com.au/clients/oceaniacapital/quotes_img.asp" alt="Quote Table" style="border: solid 1px #ddd;" /></div>'; do_action( 'genesis_before_footer' ); do_action( 'genesis_footer' ); do_action( 'genesis_after_footer' ); ?> </div><!-- end #wrap --> <?php wp_footer(); // we need this for plugins do_action( 'genesis_after' ); ?> This is what I only want to show on the home page. echo '</div><div class="quote-table"><img src="http://clients2.weblink.com.au/clients/oceaniacapital/quotes_img.asp" alt="Quote Table" style="border: solid 1px #ddd;" /></div>';
  19. Hello there. I'm a web designer trying to learn more development skills. I've written this opening hours widget for wordpress. Its functionality is very simple which is all I really need and it does the job, however I'd love to know how to make the code smaller as there are lots of thing repeating. I think parts of it could be done using a for each loop and arrays, but I can't figure out what way to do it. If anyone can help or point me in the right direction for what topic specifically to study I would be very grateful. Please see code below. Sorry if its really badly written, /** * Creating and displaying an Opening Times Widget */ wp_register_sidebar_widget( 'opening_times_widget', // your unique widget id 'Opening Times', // widget name 'opening_times_widget_display', // callback function to display widget array( // options 'description' => 'This widget displays your opening hours in your website sidebar' ) ); wp_register_widget_control( 'opening_times_widget', // id 'opening_times_widget', // name 'opening_times_widget_control' // callback function ); function opening_times_widget_control($args=array(), $params=array()) { //the form is submitted, save into database if (isset($_POST['submitted'])) { update_option('opening_times_widget_title', $_POST['widgettitle']); update_option('opening_times_widget_email', $_POST['widgetemail']); update_option('opening_times_widget_description', $_POST['description']); update_option('opening_times_widget_monday', $_POST['mondayhours']); update_option('opening_times_widget_tuesday', $_POST['tuesdayhours']); update_option('opening_times_widget_wednesday', $_POST['wednesdayhours']); update_option('opening_times_widget_thursday', $_POST['thursdayhours']); update_option('opening_times_widget_friday', $_POST['fridayhours']); update_option('opening_times_widget_saturday', $_POST['saturdayhours']); update_option('opening_times_widget_sunday', $_POST['sundayhours']); } //load options $widgettitle = get_option('opening_times_widget_title'); $widgetemail = get_option('opening_times_widget_email'); $description = get_option('opening_times_widget_description'); $mondayhours = get_option('opening_times_widget_monday'); $tuesdayhours = get_option('opening_times_widget_tuesday'); $wednesdayhours = get_option('opening_times_widget_wednesday'); $thursdayhours = get_option('opening_times_widget_thursday'); $fridayhours = get_option('opening_times_widget_friday'); $saturdayhours = get_option('opening_times_widget_saturday'); $sundayhours = get_option('opening_times_widget_sunday'); ?> Widget Title: ( eg: Opening Hours )<br /> <input type="text" class="widefat" name="widgettitle" value="<?php echo stripslashes($widgettitle); ?>" /> <br /><br /> Monday<br /> <input type="text" class="widefat" name="mondayhours" value="<?php echo stripslashes($mondayhours); ?>" /> <br /><br /> Tuesday<br /> <input type="text" class="widefat" name="tuesdayhours" value="<?php echo stripslashes($tuesdayhours); ?>" /> <br /><br /> Wednesday<br /> <input type="text" class="widefat" name="wednesdayhours" value="<?php echo stripslashes($wednesdayhours); ?>" /> <br /><br /> Thursday<br /> <input type="text" class="widefat" name="thursdayhours" value="<?php echo stripslashes($thursdayhours); ?>" /> <br /><br /> Friday<br /> <input type="text" class="widefat" name="fridayhours" value="<?php echo stripslashes($fridayhours); ?>" /> <br /><br /> Saturday<br /> <input type="text" class="widefat" name="saturdayhours" value="<?php echo stripslashes($saturdayhours); ?>" /> <br /><br /> Sunday<br /> <input type="text" class="widefat" name="sundayhours" value="<?php echo stripslashes($sundayhours); ?>" /> <br /><br /> Additional Information:<br /> <textarea class="widefat" rows="5" name="description"><?php echo stripslashes($description); ?></textarea> <br /><br /> Email Address:<br /> <input type="text" class="widefat" name="widgetemail" value="<?php echo stripslashes($widgetemail); ?>" /> <br /><br /> <input type="hidden" name="submitted" value="1" /> <?php } function opening_times_widget_display($args=array(), $params=array()) { //load options $widgettitle = get_option('opening_times_widget_title'); $description = get_option('opening_times_widget_description'); $widgetemail = get_option('opening_times_widget_email'); $mondayhours = get_option('opening_times_widget_monday'); $tuesdayhours = get_option('opening_times_widget_tuesday'); $wednesdayhours = get_option('opening_times_widget_wednesday'); $thursdayhours = get_option('opening_times_widget_thursday'); $fridayhours = get_option('opening_times_widget_friday'); $saturdayhours = get_option('opening_times_widget_saturday'); $sundayhours = get_option('opening_times_widget_sunday'); //widget output echo stripslashes($args['before_widget']); echo stripslashes($args['before_title']); echo stripslashes($widgettitle).'<span class="opening-hours-icon"> </span>'; echo stripslashes($args['after_title']); echo '<div class="textwidget">'; if ($mondayhours != '') { echo '<div class="opening-hours-day-info">Monday: <span>'.stripslashes($mondayhours).'</span></div>'; } if ($tuesdayhours != '') { echo '<div class="opening-hours-day-info">Tuesday: <span>'.stripslashes($tuesdayhours).'</span></div>'; } if ($wednesdayhours != '') { echo '<div class="opening-hours-day-info">Wednesday: <span>'.stripslashes($wednesdayhours).'</span></div>'; } if ($thursdayhours != '') { echo '<div class="opening-hours-day-info">Thursday: <span>'.stripslashes($thursdayhours).'</span></div>'; } if ($fridayhours != '') { echo '<div class="opening-hours-day-info">Friday: <span>'.stripslashes($fridayhours).'</span></div>'; } if ($saturdayhours != '') { echo '<div class="opening-hours-day-info">Saturday: <span>'.stripslashes($saturdayhours).'</span></div>'; } if ($sundayhours != '') { echo '<div class="opening-hours-day-info">Sunday: <span>'.stripslashes($sundayhours).'</span></div>'; } echo '<div class="opening-hours-description">'.stripslashes(nl2br($description)).'</div>'; if ($widgetemail != '') { echo '<div class="opening-hours-email"><a href="mailto:'.stripslashes($widgetemail).'" target="_blank">Email us</a> to arrange an appointment</div>'; } echo '</div>';//close div.textwidget echo stripslashes($args['after_widget']); }
  20. Hi, I want to scrolling down all posts in homepage. I have installed this plugin http://wordpress.org/extend/plugins/infinite-scroll/. But i could't configure the CSS settings in the infinite-scroll setting for my theme. Here is my site http://www.adventureseeker.org/ Need help. Thanks in advance. Regards.
  21. I've begged people all over the web for help with this problem. It's hard to explain because people read about it, and they think I just don't know how to execute simple navigation on WordPress. Let me try to explain: I have a website run by WordPress. I need to edit the home page. When I click Pages-->All Pages-->Home which is linked to home, it's empty. When I go to Apperence-->Editor-->Front Page Page Template it gives me PHP code to dictate basic template stuff, it won't let me edit As you can see from the site, I have things other than the featured items and so on, like the "Bridgett Provenzano" letter at the bottom. But on my supposed home page there is nothing, on my specific theme settings, I have the featured items written out and I have the PHP code for the temlpate but none of that lets me edit the stuff on the front that I need to edit, namley the stuff under the featured items. I hired someone but I don't have any money in the budget to do that again. He somehow added some text into the front page even though I see no way to do so, and cant see where he added it when I look at the code. I'm at a loss. I'm going nuts here trying to figure this out. I don't know PHP, it looks as confusing as hell.
  22. Hi I'm using wordpress and I want to create a link that will use the slug of an item from the database. For example if the user clicks on view of an item, then the link must direct the user to a page that will have more information of the item. I have this <?php global $wpdb; $bras = $wpdb->get_results("SELECT * FROM bras;"); ?> [/size][/font][/color] <table> <?php foreach($bras as $bra): ?> <td><?php echo $bra->title ?><br /> <img src="<?php echo bloginfo('template_directory').'/img/'.$bra->filename; ?>" /><br /> <?php echo $bra->content ?><br /> <?php echo $bra->price ?><br /> <a href="#" />View</a> <?php endforeach; ?> </td> </table> and then the user will click view and then get directed to bras_view which will then give the information of the item,
  23. Hello guys, I have a wordpress website wich supplies download links. What i want to do: When a user clicks o a download link (external sources) i want to redirect him to the same page (iframe) but i want to put some ads on top of the window. How can i do that ?
  24. I'm adding a new form to a WP site that's already been set up with Contact Form 7. The form data needs to be sent to a different .asp than the other forms. I've been searching all over online and closest solution I've found is: change the "action" attribute in the form using this Filter Hook wpcf7_form_action_url. You could add the hook into your theme's functions.php and then just process the form data in your ASP page. How would I need to code the php file to customize the form action url? Not familiar with php and terms, I'm completely lost and feel it's probably simple solution which I'm unaware of and would appreciate any help. Thanks so much!
  25. I have a custom filter for WordPress' wp_link_pages which allows both next/previous links and pagination to be used. However, I have an extra linked space in front of 'Next page' I can't seem to get rid of. I need to maintain the spacing while de-linking the extra space in front of "Next page". I was able to figure out how to remove the space itself, but I really just need to remove the linking from the space. The problem can be viewed in this post. add_filter('wp_link_pages_args', 'wp_link_pages_args_prevnext_add'); /*** Add prev and next links to a numbered link list */ function wp_link_pages_args_prevnext_add($args) { global $page, $numpages, $more, $pagenow; if (!$args['next_or_number'] == 'next_and_number') return $args; # exit early $args['next_or_number'] = 'number'; # keep numbering for the main part if (!$more) return $args; # exit early if($page-1) # there is a previous page $args['before'] .= _wp_link_page($page-1) . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '</a>' ; if ($page<$numpages) # there is a next page $args['after'] = _wp_link_page($page+1) .' '. $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '</a>' . $args['after'] ; return $args; }
×
×
  • 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.