Search Results

Search found 3180 results on 128 pages for 'wordpress'.

Page 28/128 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • WooCommerce Themes

    - by Matt
    Looking to run your Ecommerce website on WordPress platform? Woothemes’ WooCommerce themes are the best in this league. Here is a post where you can compare, review & choose the right one for your use. WooFramework powers all their WordPress themes. It provides a reliable, structured code base for you to customize and provides multiple [...] Related posts:Beveled Premium WordPress Theme by Woothemes 21+ WordPress Photo Blog & Portfolio Themes 12 Best WordPress Themes for Church

    Read the article

  • PHP dynamic Page-level DocBlocks

    - by Obmerk Kronen
    I was wondering if there is a way to interact with the Page-level DocBlocks. My question is more specifically about wordpress plugin development, but this question has arised also in a non-wordpress environments. The reason is mainly the possibility to easily change VERSIONS and names throughout a large project with maybe a constant definition - but that will reflect also in the docblock.. The following example Docblock is from a wordpress plugin I write - /* Plugin Name: o99 Auxilary Functions v0.4.7 Plugin URI: http://www.myurl.com Description: some simple description that nobody reads. Version: 0.4.7 Author: my cool name Author URI: http://www.ok-alsouri.com */ Is there a way to transform it into : $ver = '0.4.7'; $uri = 'http://www.myurl.com'; $desc = 'some simple description that nobody reads.'; $mcn = 'my cool name'; etc.. etc.. /* Plugin Name: o99 Auxilary Functions ($ver) Plugin URI: ($uri) Description: ($desc) Version: ($ver) Author: ($mcn) Author URI: ($$uri) */ obviously for echo to work I would need to break the docblock itself, and I can not WRITE the docblock directly into it´s own file . In shorts : can I "generate" a docblock with php itself somehow (I would think that the answer is - "no" for the page itself.. But maybe I am wrong and someone has some neat hack :-) ) Is that even possible ?

    Read the article

  • Wordpress dynamic navigation function for highlighting single post tabs

    - by user269959
    I am trying to write a function that i can reuse in my wordpress themes that will allow me to build robust dynamic navigation menus. Here is what i have so far: function tab_maker($page_name, $href, $tabname) { //opens <li> tag to allow active class to be inserted if tab is on proper page echo "<li"; //checks that we are on current page and highlights tab as active if so if(is_page($page_name)){ echo " class='current_page_item'>"; } //closes <li> tab if not active else { echo ">"; } //inserts the link as $href and the name of the tab to appear as $tabname then closes <li> echo "<a href=$href>$tabname</a>"; echo "</li>"; } This code works as expected except i cant enable it to highlight for a single blog post as the page names are dynamic. I know about the wordpress function is_single() which ive used to implement this feature in previous nav menus but i cant find a way to integrate it into this function. appreciate any help!

    Read the article

  • Wordpress and Anythingslider Navigation Thumbnails

    - by Tom
    So I am using AnythingSlider in Wordpress. This is why I am trying to call the thumbnails from the original posts. Anything slider will configure thumbnail navigation like this: function formatText(index, panel) { return index + ""; } $(function () { $('.anythingSlider').anythingSlider({ navigationFormatter: formatText // Details at the top of the file on this use (advanced use) }); }); As you can see, the navigationFormatter will allow me to format the nav (including thumbnails) however I want. For example, to format thumbnails, I could do this: navigationFormatter : function(i, panel){ // add thumbnails as navigation links return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg">'; } So my issue is getting the wordpress slide images to show up there dynamically, rather than in a folder (as the above example shows). For reference, this is my php query that is pulling the posts image (from a script I've already written: <img class="slider-img" style="float:left;" src="<?php if(function_exists('wp_get_post_image')){ echo wp_get_post_image(array( 'return_html' => false, 'width' => 500 )); } ?>" /> I hope this update helps. Thank you guys so much. The Stack overflow community is great!

    Read the article

  • PHP/SQL/Wordpress: Group a user list by alphabet

    - by rayne
    I want to create a (fairly big) Wordpress user index with the users categorized alphabetically, like this: A Amy Adam B Bernard Bianca and so on. I've created a custom Wordpress query which works fine for this, except for one problem: It also displays "empty" letters, letters where there aren't any users whose name begins with that letter. I'd be glad if you could help me fix this code so that it only displays the letter if there's actually a user with a name of that letter :) I've tried my luck by checking how many results there are for that letter, but somehow that's not working. (FYI, I use the user photo plugin and only want to show users in the list who have an approved picture, hence the stuff in the SQL query). <?php $alphabet = range('A', 'Z'); foreach ($alphabet as $letter) { $user_count = $wpdb->get_results("SELECT COUNT(*) FROM wp_users WHERE display_name LIKE '".$letter."%' ORDER BY display_name ASC"); if ($user_count > 0) { $user_row = $wpdb->get_results("SELECT wp_users.user_login, wp_users.display_name FROM wp_users, wp_usermeta WHERE wp_users.display_name LIKE '".$letter."%' AND wp_usermeta.meta_key = 'userphoto_approvalstatus' AND wp_usermeta.meta_value = '2' AND wp_usermeta.user_id = wp_users.ID ORDER BY wp_users.display_name ASC"); echo '<li class="letter">'.$letter.''; echo '<ul>'; foreach ($user_row as $user) { echo '<li><a href="/author/'.$user->user_login.'">'.$user->display_name.'</a></li>'; } echo '</ul></li>'; } } ?> Thanks in advance!

    Read the article

  • Wordpress thumbnail creation question

    - by Will Ashworth
    I'm trying to use Wordpress' built-in thumbnailing and image re-sizing in my Wordpress 2.9.2 installation. I'm trying to get various sizes (post listing/results 160x160 & "single.php" 618x150) and for some reason the single.php one works, but only half way. Not sure if I'm doing something wrong here. I have it working…sorta. I’m totally stuck and there seems to be a lack of documentation on the Codex for this feature so here goes. The small 160×160 thumbnail for article listings/search views works fine. It crops it, all’s groovy. The issue comes when I go to format the image for the single.php article details view. It crops, but then scales down even further for some reason. Screenshot: http://c1319072.cdn.cloudfiles.rackspacecloud.com/4-15-2010%204-56-46%20PM.png NOTE: every time I re-test this I’m completely deleting the image from the media section and re-uploading the image entirely. I also have the re-create thumbnails plugin so I know it’s not caching. Here is my code included in "functions.php". This will help in debugging. add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 160, 160, true ); // Normal post thumbnails add_image_size( ’single-post-thumbnail’, 618, 150, true ); // Permalink thumbnail size

    Read the article

  • JQuery & Wordpress - Hide multiple divs inside unique ID?

    - by steelfrog
    I'm trying to write a short Wordpress JQuery for Wordpress comments that would allow users to toggle specific comments on and off. This is my first script, and I'm having a tough time. Once overtly simplified, the comments are formatted like so: <li id="li-comment-<?php comment_ID() ?>"> <div class="gravatar"><img src="#" /></div> <div class="comment_poster">Username</div> <div class="comment_options">Option buttons</div> <div class="comment_content">Comment</div> </li> In the "comment_options" DIV is a series of buttons that control the individual comments (reply, quote, edit, close, etc.). The close button is what I'm trying to write this script for. I need it to toggle the "gravtar" and "comment_content" DIVs, but leave the rest in place so that it still displays the user ID and controls. However, I can't seem to figure out how to contain the action. This is what I have so far: $(document).ready(function() { $("div.trigger").click(function() { $("div.gravatar").slideToggle(); $("div.comment_content").slideToggle(); }); }); The problem with this is that it closes are the .gravatar and .comment_content on the page, not just the ones found in the same list item. If you're curious, this is the page I'm working on. Any idea how I could resolve this? Again, this is my firs time with JQuery, so I'm a little fuzzy on how it all works. Thanks!

    Read the article

  • Wordpress Rewrite Redirect Failure

    - by Rory Hart
    I'm helping a friend recover from the mess outsourcing a wordpress website caused him (mistake #1) and I have this weird error. The hosting he is using appears to be redirecting www.domain.com to domain.com (NFI why) automatically which works fine in every browser except IE (i know right!). So adding the first redirect fixed that, until I added the permalink redirect. Now when IE goes to an old wordpress link like http://www.domain.com/?p=520 the redirect fails. RewriteEngine On RewriteBase / # Rewrite rule for wierd redirect issue RewriteCond %{HTTP_HOST} ^www.domain.com$ RewriteRule ^/?(.*)$ "http\:\/\/doman\.com\/$1" [R=301,L] # Rewrite Rule for Wordress Permalinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] I tested this out with wget and it complains: ERROR: Redirection (301) without location. So it seems likely that IE is suffering from the same error (without the helpful error message). But I haven't a clue how to fix it. I am hoping that he will switch hosting companies but we will see. In the meantime any ideas?

    Read the article

  • Wordpress XML-RPC call from Objective C: wp.newComment

    - by radesix
    I'm using Eric Czarny's Cocoa XML-RPC framework to make a call to the Wordpress API's. I've downloaded the sample app from Wordpress which gives some good examples. Unfortunately the good examples are for every call EXCEPT wp.newComment. I'm trying to post a comment using the code below and I keep getting an error with a localized description that tells me to check my input parameters. I've checked and rechecked and I don't understand what is wrong. Any ideas? NSDictionary *commentStructure = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:0], @"comment_parent", @"xmlrpc anonymous comments plugin now enabled", @"content", @"Test Author", @"author", @"http://iphone.someurl.com", @"author_url", @"[email protected]", @"author_email", nil]; NSArray *args = [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", @"", [NSNumber numberWithInt:[self.parentFeedItem.postID intValue]], commentStructure, nil]; // the param(s) NSString *server = [[[NSString alloc] initWithString:@"http://www.someurl.com/xmlrpc.php"] autorelease]; // the server NSString *method = [[[NSString alloc] initWithString:@"wp.newComment"] autorelease]; // the method XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:server]]; [request setMethod:method withObjects:args]; id response = [self executeXMLRPCRequest:request]; [request release]; if( [response isKindOfClass:[NSError class]] ) { //return nil; NSLog(@"There was a problem"); NSLog([response localizedDescription]); }

    Read the article

  • Reading a Wordpress function description

    - by Casebash
    I want to be able to understand the standard function description that is provided for Wordpress functions. In particular, could someone explain the following example from here: Usage <?php wp_list_categories( $args ); ?> Default Usage <?php $args = array( 'show_option_all' => , 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => , 'feed_type' => , 'feed_image' => , 'exclude' => , 'exclude_tree' => , 'include' => , 'current_category' => 0, 'hierarchical' => true, 'title_li' => __( 'Categories' ), 'number' => NULL, 'echo' => 1, 'depth' => 0 ); ?> I can guess most of it, but in particular I can't guess: What does blank after the comma mean? Empty string? What is the __? How do I call the function? Keyword like python, positional arguments or do I have to pass an array? Is there anything else about Wordpress function descriptions which isn't covered in this example? Thanks, Chris

    Read the article

  • wordpress extended_valid_elements for script tag?

    - by John
    Can someone tell me how to tell Wordpress' tinymce editor to NOT strip out script tags? I looked in wp-admin/includes/post.php and added 'extended_valid_elements'=>'script[charset|defer|language|src|type]', to the $initArray. When I do a view source on the CMS post editor, I see taht it does show up like so: <script type="text/javascript"> /* <![CDATA[ */ tinyMCEPreInit = { base : "http://dev.esolar.ca/wp-includes/js/tinymce", suffix : "", query : "ver=327-1235", mceInit : {mode:"specific_textareas", editor_selector:"theEditor", width:"100%", theme:"advanced", skin:"wp_theme", theme_advanced_buttons1:"bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,wp_more,|,spellchecker,fullscreen,wp_adv", theme_advanced_buttons2:"formatselect,underline,justifyfull,forecolor,|,pastetext,pasteword,removeformat,|,charmap,|,outdent,indent,|,undo,redo,wp_help", theme_advanced_buttons3:"", theme_advanced_buttons4:"", language:"en", spellchecker_languages:"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv", theme_advanced_toolbar_location:"top", theme_advanced_toolbar_align:"left", theme_advanced_statusbar_location:"bottom", theme_advanced_resizing:"1", theme_advanced_resize_horizontal:"", dialog_type:"modal", relative_urls:"", remove_script_host:"", convert_urls:"", apply_source_formatting:"", remove_linebreaks:"1", gecko_spellcheck:"1", entities:"38,amp,60,lt,62,gt", accessibility_focus:"1", tabfocus_elements:"major-publishing-actions", media_strict:"", paste_remove_styles:"1", paste_remove_spans:"1", paste_strip_class_attributes:"all", wpeditimage_disable_captions:"", plugins:"safari,inlinepopups,spellchecker,paste,wordpress,media,fullscreen,wpeditimage,wpgallery,tabfocus"}, load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} }; /* ]]> */ </script> But for some reason ,my editor still doesn't save <script> tags. What am I doing wrong?

    Read the article

  • Wordpress/CSS: List Style Problem.

    - by Ben
    Hi all! I am reasonably new to Wordpress custom themes but I do have some knowlege of CSS, although I am terrible at customising other peoples code which is why I have the problem I am about to explain. I have started a website that my girlfriend and I are doing together. It uses the Simplo Wordpress theme which is pretty cool but when you add a post that has a list in it. It doesn't show the bullets on each of the items. I have tried adding 'list-style:circle;' to a the.postItem class and a couple of other divs and classes that I thought were relevant but it doesn't work. You can take a look for yourself, it may be easier to understand my problem that way. If you go to: http://brokeandstarving.com/234/bennos-shepherds-pie/ there is a list of ingredients and also the steps under the method is a list as well. My question is, where do I edit the CSS to make the bullets appear next to the list items? I hope that makes sense. Thanks in advance, - Ben

    Read the article

  • Uploading a file fails under WordPress

    - by Ash
    I'm using WordPress and I'm following W3's guide for uploading a file: HTML code: <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> PHP code (upload_file.php): <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } ?> The HTML code is pasted in a PHP page template and the PHP file under the WP installation directory under www. The problem is when I submit the file I get Error: 1. If I remark the "if" part of the PHP code and leave the "else" part I get: Upload: IMG_4258.JPG Type: Size: 0 Kb Stored in: So at least I know the PHP code is running. But what's causing it to fail? Is there a problem with the code or is WordPress meddling with the process?

    Read the article

  • $HTTP_RAW_POST_DATA and Wordpress media_handle_upload

    - by BaronVonKaneHoffen
    Hi there! So I'm making something for which users need to upload images from a canvas element (on the front end) using Wordpress's in-built Media Upload API. I've successfully uploaded images with the API from a file input in a form: <input type="file" name="async-upload" id="async-upload" size="40" /> ... <?php $new_attach_id = media_handle_upload( 'async-upload', $new_id ); ?> and I've saved images from the canvas using my own script: <script type="text/javascript"> ... var img = canvas.toDataURL("image/png"); ... ajax.send(img ); </script> ... <?php $imageData=$GLOBALS['HTTP_RAW_POST_DATA']; $filteredData=substr($imageData, strpos($imageData, ",")+1); $unencodedData=base64_decode($filteredData); $fp = fopen( 'saved_images/canv_save_test.png', 'wb' ); fwrite( $fp, $unencodedData); ... ?> Problem is, Wordpress's media_handle_upload() only accepts an index to the $_FILES array for the upload. So the question is: How can I pass the image data from HTTP_RAW_POST_DATA to it? Could I make the $_FILES['tmp-name'] point to it somehow? Could I use another script as an intermediate step somehow? Could I unleash the monkeys on the typewriter until they come up with the answer? Any help very very much appreciated! Thanks, Kane

    Read the article

  • Acessing a wordpress database from an iPhone App.

    - by Code
    Hi guys, I've been asked to create an app that will get data back from a database where the CMS will be Wordpress. I've never used a CMS so I'm trying to get a (overview)picture in my head of how it could all work and what each of the components would be. And what a CMS actually brings to the party. Creating the app itself is pretty clear. I've done a few already. I've made a database before and shouldnt cause a problem. But what is going to be in the middle between the app and the database? Part A: I'm guessing iphone apps typically would call some php file that's hosted on the server? The php then would make a call to the database and return the data somehow, maybe as xml. But this is really basic and wouldnt require a CMS. Just a database and a phpfile, or am I wrong? Part B: If i wanted to run a check on the database every minute to see if any of the data in database was no longer valid and remove it if needed, that would require somekind of program running on the server. So that program would be Wordpress, since it is managing the content, so a content management system is actually needed and is for these kind of taskes. Am i understanding the role of CMS? Many Thanks, -Code

    Read the article

  • Wordpress Query Compare operator not working?

    - by Liam
    I have the following wordpress query... $args = array('orderby' => 'meta_value_num', 'meta_key' => 'order', 'order' => 'ASC', 'meta_query' => array( array( 'key' => $customkey, 'value' => $customvalue, 'compare' => '=' ), array( 'key' => $customkey1, 'value' => $customvalue1, 'compare' => '=' ), array( 'key' => 'coverageRegion', 'value' => 'national', 'compare' => '=' ), array( 'key' => 'vehicleType', 'value' => 'psv', 'compare' => '!=' ) ) ); I want to return posts where there custom field 'Vechicle Type' is not PSV, The above however returns posts with exactly that, has anybody come across this before? Seems im not the only one neither... http://wordpress.org/support/topic/meta_query-without-key-results-in-compare-of-not-like-not-working

    Read the article

  • WPML is not detecting Wordpress custom post types

    - by janoChen
    I learned how to make custom post types with the following tutorial: http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/ It basically consist in adding this code to function.php: add_action( 'init', 'create_events' ); function create_events() { $labels = array( 'name' => _x('Events', 'post type general name'), 'singular_name' => _x('Event', 'post type singular name'), 'add_new' => _x('Add New', 'Event'), 'add_new_item' => __('Add New Event'), 'edit_item' => __('Edit Event'), 'new_item' => __('New Event'), 'view_item' => __('View Event'), 'search_items' => __('Search Events'), 'not_found' => __('No Events found'), 'not_found_in_trash' => __('No Events found in Trash'), 'parent_item_colon' => '' ); $supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt'); register_post_type( 'event', array( 'labels' => $labels, 'public' => true, 'supports' => $supports ) ); } The WPML plugin help you to translate posts to different langauges. But this option doesn't appear in the custom post types. Any suggestions?

    Read the article

  • How To Add/Remove Multi Rows In jQuery And Wordpress

    - by SUBSWISS
    Hey All I'm making a wordpress theme options page, and one of the options I want to make is how to add/removes dynamic rows by that the user can make it when he want to add a block. something like this <table id="block" width="350px" border="0"> <tr> <td> 1 </td><!--Nomber of the row--> <td><input type="text" /><br /><label>Title</label></td><!--Title of the row--> <td><input type="text" /><br /><label>IMG Link</label></td><!--Image of the row--> <td><textarea type="textarea" cols="40" rows="2"></textarea><br /><label>Description</label></td> </tr> </table> and the result will be something like this : Please Click Here To See The Image Beside I want to make it saved to wordpress when updating are saved . Thank you. Karar

    Read the article

  • Stopping Wordpress From Appending /index.html to everything

    - by user439796
    I have a spaghetti code of a theme I inherited from someone and for whatever reason Google Analytics shows that I keep getting hits to a variety of URLs on the site, but the urls are all appended with /index.html. So an example would be like http://www.mysite.com/category/storyname/index.html And it appears to be doing this to almost everything (despite my permalinks being set to be "tidy"). So... What in the hell could be possibly causing this? How do I fix it? When I visit all those pages I get 404 errors so that means my visitors are not getting what they want. I have the Redirection plugin and have been manually trying to update some of these, but it is ridiculous. I'm sure there's a way to do it with htaccess but I know next to nothing about that. Here's what my htaccess currently has (the default): # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

    Read the article

  • Help to edit the Recent Posts Wordpress widget to diplay in all 3 languages at once

    - by CreativEliza
    Site link: http://nuestrafrontera.org/wordpress/ I want the feed of recent post titles to show in the sidebar for all 3 languages, separated by language. So, for example, under Recent Posts the sidebar would have "English" and then the latest 3 posts in English, then "Español" and the latest 3 in Spanish and then French. All in a list in the column and appearing on all pages with the sidebar in all languages. I am using the most current version of Wordpress with the WPML plugin. I believe the Wordpress widget for Recent Posts needs to be tweaked to do this. Here is the code (from wp-includes/default-widgets.php): class WP_Widget_Recent_Posts extends WP_Widget { function WP_Widget_Recent_Posts() { $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your blog") ); $this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops); $this->alt_option_name = 'widget_recent_entries'; add_action( 'save_post', array(&$this, 'flush_widget_cache') ); add_action( 'deleted_post', array(&$this, 'flush_widget_cache') ); add_action( 'switch_theme', array(&$this, 'flush_widget_cache') ); } function widget($args, $instance) { $cache = wp_cache_get('widget_recent_posts', 'widget'); if ( !is_array($cache) ) $cache = array(); if ( isset($cache[$args['widget_id']]) ) { echo $cache[$args['widget_id']]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title']); if ( !$number = (int) $instance['number'] ) $number = 10; else if ( $number < 1 ) $number = 1; else if ( $number > 15 ) $number = 15; $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); if ($r->have_posts()) : ?> <?php echo $before_widget; ?> <?php if ( $title ) echo $before_title . $title . $after_title; ?> <ul> <?php while ($r->have_posts()) : $r->the_post(); ?> <li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li> <?php endwhile; ?> </ul> <?php echo $after_widget; ?> <?php wp_reset_query(); // Restore global post data stomped by the_post(). endif; $cache[$args['widget_id']] = ob_get_flush(); wp_cache_add('widget_recent_posts', $cache, 'widget'); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = (int) $new_instance['number']; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset($alloptions['widget_recent_entries']) ) delete_option('widget_recent_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('widget_recent_posts', 'widget'); } function form( $instance ) { $title = esc_attr($instance['title']); if ( !$number = (int) $instance['number'] ) $number = 5; ?> <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p> <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:'); ?></label> <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /><br /> <small><?php _e('(at most 15)'); ?></small></p> <?php } }

    Read the article

  • Syntax error, unexpected '}' wordpress error

    - by Zach Johnson
    Hello I am not a PHP programmer so I have no idea what the problem is here. Basiclly I am trying to use a wordpress theme but I get this error The Parse error: syntax error, unexpected '}' in / home/a5618915/public_html/photo/wp-content/themes/iphoto/functions.php on line 1 I have no Idea what exactly is wrong in the php file. The code for the functions.php is below. If someone could point out whats wrong I would be really grateful. <?php define('THEME_NAME','iphoto'); load_theme_textdomain( THEME_NAME,TEMPLATEPATH .'/languages'); add_custom_background(); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-formats', array( 'video')); if ( function_exists('register_nav_menus') ) { register_nav_menus(array('primary' => 'header')); } add_action('wp_ajax_b_ajax_post_action', 'b_ajax_callback'); function b_ajax_callback() { global $wpdb; if(isset($_POST['type']) && $_POST['type'] == 'upload') { $clickedID = $_POST['data']; $filename = $_FILES[$clickedID]; $filename['name'] = preg_replace('/[^a-zA-Z0-9._-]/', '', $filename['name']); $override['test_form'] = false; $override['action'] = 'wp_handle_upload'; $uploaded_file = wp_handle_upload($filename,$override); $upload_tracking[] = $clickedID; update_option($clickedID, $uploaded_file['url'] ); if(!empty($uploaded_file['error'])) {echo 'Upload Error: ' . $uploaded_file['error']; } else { echo $uploaded_file['url']; } } die(); } function post_thumbnail($a){ global $post; $post_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/\<img.+?src="(.+?)".*?\/>/is',$post->post_content,$matches ,PREG_SET_ORDER); $cnt = count( $matches ); if($a==1){ if($cnt>0){ if($cnt>1){ if($cnt>3) $cnt=3; for($i=0;$i<$cnt;$i++){ $post_current = $i+1; $post_img_src = $matches[$i][1]; if($i==0){$post_spans .= '<span class="current">'.$post_current.'</span>';}else{ $post_spans .= '<span>'.$post_current.'</span>'; } $post_imgs .='<img src="'.get_bloginfo('template_url').'/timthumb.php?src='.$post_img_src.'&amp;w=285&amp;zc=1" />'; } $post_img = $post_imgs.'<span class="imgNav">'.$post_spans.'</span>'; }else{ $post_img_src = $matches [0][1]; $post_img = '<img src="'.get_bloginfo('template_url').'/timthumb.php?src='.$post_img_src.'&amp;w=285&amp;zc=1" />'; } echo $post_img; } }else{ return $cnt; } } function post_content_thumbnail($c) { if(is_single()){ $c = preg_replace('/\width="*".+?height="*"/i', '', $c); $s = array('/src="(.+?.(jpg|bmp|png|jepg|gif))".+?/i' => 'src="'.get_bloginfo("template_url").'/timthumb.php?src=$1&amp;h=440&amp;zc=1"'); foreach($s as $p => $r){ $c = preg_replace($p,$r,$c); } return $c; } } add_filter( 'the_content', 'post_content_thumbnail' ); function ajax_post(){ if( isset($_GET['action'])&& $_GET['action'] == 'ajax_post'){ if(isset($_GET['cat'])){ $args = array( 'category_name' => $_GET['cat'], 'paged' => $_GET['pag'] ); }else if(isset($_GET['pag'])){ $args = array( 'paged' => $_GET['pag'] ); } query_posts($args); if(have_posts()){while (have_posts()):the_post();?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile;} die(); }else{return;} } add_action('init', 'ajax_post'); function pagenavi( $p = 2 ) { if ( is_singular() ) return; global $wp_query,$paged; $max_page = $wp_query->max_num_pages; if ( $max_page == 1 ){ echo '<span id="post-current">1</span> / <span id="post-count">1</span>'; return; } if ( empty( $paged ) ) $paged = 1; if ( $paged >1 ) echo "<a id='prev' title='Prev' href='",esc_html( get_pagenum_link( $paged -1 ) ),"'>&lt;&lt;</a> "; echo '<span id="post-current">'.$paged .'</span> / <span id="post-count">'.$max_page .'</span>'; if ( $paged <$max_page ) echo "<a id='next' title='Next' href='",esc_html( get_pagenum_link( $paged +1) ),"'>&gt;&gt;</a> "; } function iphoto_comment($comment,$args,$depth) { $GLOBALS['comment'] = $comment; ;echo ' <li ';comment_class();;echo ' id="li-comment-';comment_ID() ;echo '" > <div id="comment-';comment_ID();;echo '" class="comment-body"> <div class="commentmeta">';echo get_avatar( $comment->comment_author_email,$size = '48');;echo '</div> ';if ($comment->comment_approved == '0') : ;echo ' <em>';_e('Your comment is awaiting moderation.') ;echo '</em><br /> ';endif;;echo ' <div class="commentmetadata">&nbsp;-&nbsp;';printf(__('%1$s %2$s'),get_comment_date('Y.n.d'),get_comment_time('G:i'));;echo '</div> <div class="reply">';comment_reply_link(array_merge( $args,array('depth'=>$depth,'max_depth'=>$args['max_depth'],'reply_text'=>__('Reply')))) ;echo '</div> <div class="vcard">';printf(__('%s'),get_comment_author_link()) ;echo '</div> ';comment_text() ;echo ' </div> '; } add_action('admin_init', 'iphoto_init'); function iphoto_init() { if (isset($_GET['page']) && $_GET['page'] == 'functions.php') { $dir = get_bloginfo('template_directory'); wp_enqueue_script('adminjquery', $dir . '/includes/admin.js', false, '1.0.0', false); wp_enqueue_style('admincss', $dir . '/includes/admin.css', false, '1.0.0', 'screen'); } } add_action('admin_menu','iphoto_page'); function iphoto_page (){ if ( count($_POST) >0 &&isset($_POST['iphoto_settings']) ){ $options = array ('keywords','description','analytics','lib','views','noajax','animate','phzoom','copyright'); foreach ( $options as $opt ){ delete_option ( 'iphoto_'.$opt,$_POST[$opt] ); add_option ( 'iphoto_'.$opt,$_POST[$opt] ); } } add_theme_page('iPhoto '.__('Theme Options',THEME_NAME),__('Theme Options',THEME_NAME),'edit_themes',basename(__FILE__),'iphoto_settings'); } function iphoto_settings(){?> <div class="wrap"> <div> <h2><?php _e( 'iPhoto Theme Options<span>Version: ',THEME_NAME);?><?php $theme_data=get_theme_data(TEMPLATEPATH . '/style.css'); echo $theme_data['Version'];?></span></h2> </div> <div class="clear"></div> <form method="post" action=""> <div id="theme-Option"> <div id="theme-menu"> <span class="m1"><?php _e( 'jQuery Effect',THEME_NAME);?></span> <span class="m2"><?php _e( 'Relative Plugins',THEME_NAME);?></span> <span class="m3"><?php _e( 'Website Information',THEME_NAME);?></span> <span class="m4"><?php _e( 'Analytics Code',THEME_NAME);?></span> <span class="m5"><?php _e( 'Footer Copyright',THEME_NAME);?></span> <span class="m6"><?php _e( 'iPhoto Theme Declare',THEME_NAME);?></span> <div class="clear"></div> </div> <div id="theme-content"> <ul> <li> <tr><td> <em><?php _e( 'iPhoto use jquery 1.4.4 which contained in this theme, you can also use the Google one instead.',THEME_NAME);?></em><br/> <label><input name="lib" type="checkbox" id="lib" value="1" <?php if (get_option('iphoto_lib')!='') echo 'checked="checked"' ;?>/><?php _e( 'Load the jQuery Library supported by Google',THEME_NAME);?></label><br/><br/> </td></tr> <tr><td> <em><?php _e( 'Index page infinite loading posts.',THEME_NAME);?></em><br/> <label><input name="noajax" type="checkbox" id="noajax" value="1" <?php if (get_option('iphoto_noajax')!='') echo 'checked="checked"' ;?>/><?php _e( 'Deactivate the Infinite loading posts',THEME_NAME);?></label><br/><br/> </td></tr> <tr><td> <em><?php _e( '<strong>Animation of relayout elements</strong>',THEME_NAME);?></em><br /> <input name="animate" type="checkbox" id="animate" value="1" <?php if (get_option('iphoto_animate')!='') echo 'checked="checked"';?>/><?php _e( 'Deactivate animation effect on index page',THEME_NAME);?> </td></tr> </li> <li> <tr><td> <em><?php _e( 'WP-PostViews, Enables you to display how many times a post/page had been viewed.',THEME_NAME);?></em><br/> <label><input name="views" type="checkbox" id="views" value="1" <?php if (get_option('iphoto_views')!='') echo 'checked="checked"' ?>/><?php _e( 'Activate WP-PostViews',THEME_NAME);?></label><br/><br/> </td></tr> </li> <li> <tr><td> <?php _e( '<em>Keywords, separate by English commas. like MuFeng, Computer, Software</em>',THEME_NAME);?><br/> <textarea name="keywords" id="keywords" rows="1" cols="70" style="font-size:11px;width:100%;"><?php echo get_option('iphoto_keywords');?></textarea><br/> </td></tr> <tr><td> <?php _e( '<em>Description, explain what\'s this site about. like MuFeng, Breathing the wind</em>',THEME_NAME);?><br/> <textarea name="description" id="description" rows="3" cols="70" style="font-size:11px;width:100%;"><?php echo get_option('iphoto_description');?></textarea> </td></tr> </li> <li> <tr><td> <?php _e( 'You can get your Google Analytics code <a target="_blank" href="https://www.google.com/analytics/settings/check_status_profile_handler">here</a>.',THEME_NAME);?></label><br> <textarea name="analytics" id="analytics" rows="5" cols="70" style="font-size:11px;width:100%;"><?php echo stripslashes(get_option('iphoto_analytics'));?></textarea> </td></tr> </li> <li> <tr><td> <textarea name="copyright" id="copyright" rows="5" cols="70" style="font-size:11px;width:100%;"><?php if(stripslashes(get_option('iphoto_copyright'))!=''){echo stripslashes(get_option('iphoto_copyright'));}else{echo 'Copyright &copy; '.date('Y').' '.'<a href="'.home_url( '/').'" title="'.esc_attr( get_bloginfo( 'name') ).'">'.esc_attr( get_bloginfo( 'name') ).'</a> All rights reserved'; };?></textarea> <br/><em><?php _e( '<b>Preview</b>',THEME_NAME);?><span> : </span><span><?php if(stripslashes(get_option('iphoto_copyright'))!=''){echo stripslashes(get_option('iphoto_copyright'));}else{echo 'Copyright &copy; '.date('Y').' '.'<a href="'.home_url( '/').'" title="'.esc_attr( get_bloginfo( 'name') ).'">'.esc_attr( get_bloginfo( 'name') ).'</a> All rights reserved'; };?></span></em> </td></tr> </li> <li> <tr><td> <p><?php _e('iPhoto is created, developed and maintained by <a href="http://mufeng.me/">MuFeng</a>. If you like iPhoto, please donate. It will help in developing new features and versions.',THEME_NAME);?><?php _e('Alipay',THEME_NAME);?>:</strong> <a href="http://www.alipay.com" target="_blank" title="Alipay">[email protected]</a></p> <h3 style="color:#333" id="introduce"><?php _e( 'Introduction',THEME_NAME);?></h3> <p style="text-indent: 2em;margin:10px 0;"><?php _e( 'iPhoto is evolved from one theme of Tumblr and turned it into a photo theme which can be used at wordpress.',THEME_NAME);?></p> <h3 style="color:#333"><?php _e( 'Published Address',THEME_NAME);?></h3> <p id="release" style="text-indent: 2em;margin:10px 0;"><a href="http://mufeng.me/wordpress-theme-iphoto.html" target="_blank">http://mufeng.me/wordpress-theme-iphoto.html</a></p> <h3 style="color:#333"><?php _e( 'Preview Address',THEME_NAME);?></h3> <p id="preview" style="text-indent: 2em;margin:10px 0;"><a href="http://mufeng.me/photo/" target="_blank">http://mufeng.me/photo/</a></p> <h3 style="color:#333" id="bug"><?php _e( 'Report Bugs',THEME_NAME);?></h3> <p style="text-indent: 2em;margin:10px 0;"><?php _e( 'Weibo <a href="http://weibo.com/meapo" target="_blank">@mufeng.me</a> or leave a message at <a href="http://mufeng.me" target="_blank">http://mufeng.me</a>?',THEME_NAME);?></p> </td></tr> </li> </ul> </div> </div> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Options',THEME_NAME);?>" /> <input type="hidden" name="iphoto_settings" value="save" style="display:none;" /> </p> </form> </div> <?php } ?>

    Read the article

  • WordPress - Emergency Access Without Admin Accounts

    In some cases, when you need to do something in a WordPress website, but all you have is only access to WordPress database and FTP, and you cannot get the admin password from the database because it's decrypted. All changes you have to make via some low level MySQL queries, it's hard and easy mistaken. Joost de Valk has written a script for emergency access to WordPress dashboard by changing admin password or creating new user.

    Read the article

  • 10 Things You Should Do After You Install WordPress

    It's a good idea to go to your server and locate the WordPress instruction and installation file that is automatically uploaded with the WordPress software. You need to rename this file to something random and hard to guess. This is a preventative measure to deter hackers from easily finding that your site runs WordPress and trying to exploit any vulnerabilities in the software.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >