Skip to main content

Home/ Wordpress/ Group items tagged PHP

Rss Feed Group items tagged

Vernon Fowler

WordPress 3.5 And WPDB Prepare - 0 views

  • “Warning: Missing argument 2 for wpdb::prepare()” How do I fix it? If you are seeing an error after upgrading to WordPress 3.5 that says something like this, you need to upgrade your theme. We have fixed this with all of our themes and they are ready to download and re-install from your account page. What if I have customized my theme’s code and don’t want to upgrade? For those of you who have customized your theme’s code and don’t want to do a full upgrade, you’ll need to take a look at the warning message. Here’s a sample error we have fixed from the Biznify Theme: Warning: Missing argument 2 for wpdb::prepare(), called in /home/mintthem/public_html/demo/wp-content/themes/Biznify/products-pagetemplate.php on line 39 and defined in /home/mintthem/public_html/demo/wp-includes/wp-db.php on line 990 Step 1: Open the file it tells you to open. In this case, it is products-pagetemplate.php and Go to the line it refers to. In this case it is line 39 Step 2: Find the code that looks like this: $wpdb->prepare(“SELECT price FROM $table_name WHERE item_number = ‘$item_number’;”) Step 3: Replace $item_number with %d Step 4: Add $item_number after the last quotation mark. Also, make sure to put a comma before it. (notice the comma before $item_number below) Example: $wpdb->prepare(“SELECT price FROM $table_name WHERE item_number = ‘%d‘;”, $item_number)
  • $price = $wpdb->get_var($wpdb->prepare(“SELECT price FROM $table_name WHERE item_number = ‘%d‘;”, $item_number));
  • WordPress 3.5 And WPDB Prepare
Vernon Fowler

Transfer WordPress Image Captions to HTML5 - 0 views

  • How to transfer the default code to html5? Here it is: open the functions.php (you can find it in the theme folder), then copy and paste the following php code to the functions.php
Vernon Fowler

Child Themes « WordPress Codex - 0 views

  • A child theme resides in its own directory in wp-content/themes. The scheme below shows the location of a child theme along with its parent theme (Twenty Twelve) in a typical WordPress directory structure:
  • This directory can contain as little as a style.css file, and as much as any full-fledged WordPress theme contains: style.css (required) functions.php (optional) Template files (optional) Other files (optional)
  • @import url("../twentytwelve/style.css");
  • ...4 more annotations...
  • Note on the @import rule There must be no other CSS rules above the @import rule. If you put other rules above it, it will be invalidated and the stylesheet of the parent will not be imported.
  • Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
  • But, when creating child themes, be aware that using add_theme_support('post-formats') will override the formats as defined by the parent theme, not add to it.
  • A child theme can override any parental template by simply using a file with the same name.
Michael Sturgeon

10 awesome PHP functions and snippets - StumbleUpon - 1 views

  •  
    Every web developer should keep useful code snippets in a personal library for future reference. Today, I'm showing you the 10 most useful snippets and functions I have added to my snippet library from the past 3 months.
David McCart

Yoast GA Plugin for WP - Cross Site Scripting Vulnerability - 14 views

Yoast GA Plugin for WP - Cross Site Scripting Vulnerability Version Affected: 3.2.4 (newest) Info: The Google Analytics for WordPress plugin automatically tracks and segments all outbound links f...

XSS wordpress plugin

started by David McCart on 04 Dec 09 no follow-up yet
Tsudo liked it
anonymous

Want to remove "Latest Headlines" part from home.php (Wordpress Arras Theme) - 0 views

  •  
    My question at the Arras Theme Community Forums asking how to remove the "latest Headlines" from the home.php file.
Anna Johansson

Add page/post slug class to menu item classes | WPreso - 0 views

  •  

    function add_slug_class_to_menu_item($output){
    $ps = get_option('permalink_structure');
    if(!empty($ps)){
    $idstr = preg_match_all('/
    foreach($matches[1] as $mid){
lavanya jagan

How to Remove Links in Thesis Theme footer.php | Levoltz - 2 views

  • Thesis WordPress Theme is the theme that this blog uses and I highly recommend it it to all Bloggers. Very easy to use and no coding knowledge required, it is also higly customisable.
  •  
    Thesis WordPress Theme is the theme that this blog uses and I highly recommend it it to all Bloggers. Very easy to use and no coding knowledge required, it is also higly customisable.
trimantra

How to setup multiple site in wordpress | Trimantra Blog - 0 views

  •  
    This new feature is being called Network or Multi-site option. In WordPress By default this feature is disabled. If you want to use this option in your WordPress, you need to enable it.To enable this feature, simply open your wp-config.php file located in your WordPress root folder.
  •  
    This new feature is being called Network or Multi-site option. In WordPress By default this feature is disabled. If you want to use this option in your WordPress, you need to enable it.To enable this feature, simply open your wp-config.php file located in your WordPress root folder.
Peter Nilsson

WordPress CDN Giveaway - Win a 1TB KeyCDN Account - 0 views

  • We are excited to announce a giveaway in which you can win 1 of 3, 1TB KeyCDN accounts to turbocharge your WordPress website!<img src="http://8degreethemes.com/wp-content/plugins/affiliates-manager/imp.php?wpam_refkey=qGaxVSZKPFv7ENzQ0DEjYo3NQVB10000000000" width="0" height="0" /><img src="http://8degreethemes.com/wp-content/uploads/2015/12/250-250-affiliate-banner.png" style="border: 0;" title=""/>KeyCDN is a high-performance Content Delivery Network (CDN) which will speed up your WordPress website. It integrates with all the popular 3rd party caching plugins. They also have their own lightweight CDN plugin, CDN Enabler which allows you to deploy your CDN in minute
  •  
    We are excited to announce a new awesome giveaway in which you can win 1 of 3, 1TB KeyCDN accounts to turbocharge your WordPress website!
AResource Pool

AResourcepool Portfolio - Web, App Development and SEO Work - 0 views

  •  
    Visit our work portfolio and hire our web development & mobile app developers India. Our service location is - USA, UK and India. Hire PHP Developer India, Hire Wordpress developer India, Hire HTML5 Developer India, Hire Drupal Developer India, Hire Magento Developer India, Hire iphone app developer India, Hire Android App Developer India,
Luciano Ferrer

Convertir fechas de PHP a castellano - 2 views

  •  
    "function fechaCastellano ($fecha) { $fecha = substr($fecha, 0, 10); $numeroDia = date('d', strtotime($fecha)); $dia = date('l', strtotime($fecha)); $mes = date('F', strtotime($fecha)); $anio = date('Y', strtotime($fecha)); $dias_ES = array("Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); $dias_EN = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); $nombredia = str_replace($dias_EN, $dias_ES, $dia); $meses_ES = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $meses_EN = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $nombreMes = str_replace($meses_EN, $meses_ES, $mes); return $nombredia." ".$numeroDia." de ".$nombreMes." de ".$anio; }"
Luciano Ferrer

How to: Add shortcodes in sidebar Widgets - 1 views

  •  
    "To allow shortcodes in sidebar widgets, simply edit the functions.php file from your them and add the following code: add_filter('widget_text', 'do_shortcode');"
Vernon Fowler

Post Types « WordPress Codex - 1 views

  • it is better if you prefix your identifier with a short namespace that identifies your plugin, theme or website that implements the custom post type. For example: acme_product or aw_product for products post type used by a hypothetical ACMEWidgets.com website
  • Namespacing your custom post type identifier will not guarantee against conflicts but will certainly minimize their likelihood.
  • Do pay close attention to not having your custom post type identifier exceed 20 characters though, as the post_type column in the database is currently a VARCHAR field of that length.
  • ...6 more annotations...
  • register_post_type( 'acme_product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ) ), 'public' => true, 'has_archive' => true, ) );
  • When you namespace a custom post type identifier and still want to use a clean URL structure, you need to set the rewrite argument of the register_post_type() function. For example, assuming the ACME Widgets example from above:
  • 'rewrite' => array('slug' => 'products'),
  • Note: In some cases, the permalink structure must be updated in order for the new template files to be accessed when viewing posts of a custom post type.
  • single posts of a custom post type will use single-{post_type}.php and their archives will use archive-{post_type}.php where {post_type} is the $post_type argument of the register_post_type() function.
  • In any template file of the WordPress theme system, you can also create new queries to display posts from a specific post type. This is done via the post_type argument of the WP_Query object.
‹ Previous 21 - 40 of 186 Next › Last »
Showing 20 items per page