Backend of the WordPress.com [closed]

WordPress certainly can scale. WordPress.com alone served 14.6 billion pages last month. The key is that they had hundreds of servers so that they can widely distribute the load. Since they have a more tightly controlled platform, which helps them ensure that they don’t have badly written code slowing things down. But in the end, … Read more

Change url tag name

This has nothing to do with htaccess and/or rewrites—at least not directly by you. Just go to Settings -> Permalinks in your WordPress Admin. Then, in the Optional section, set Tag base to article. Hit Save Changes, and that’s it.

What does $_GET[‘iphone’] do?

$_GET is for accessing variables in URL parameters, it’s not related to any detection by itself, something must be adding it to URL. In context of WordPress it might be related to $is_iphone global. If you look at wp-includes/vars.php there is number of global variables like this, which WP fills up with data via user … Read more

Woocommerce display one random product via php

You could treat products like any other post type and query using get_posts(). Limit the number of posts retrieved to 1 and change the orderby parameter to random: $args = array( ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’, ‘post_type’ => ‘product’ ); $random_products = get_posts( $args ); foreach ( $random_products as $post ) : setup_postdata( $post … Read more

How do I create a numbered list with PHP? [closed]

This is pure PHP. $items = get_post_meta($post->ID, “item-specific-meta”); $item_id = 1; $output=””; foreach ($items as $item) { $output .= ‘<label for=”item-‘.$item_id.'”><input id=”item-‘.$item_id.'”/>’.$item.'</label>’; ++$item_id; }

Help getting previously visited pages ID

get_page_by_path() should help you here. Something like this <php $prev_url = isset($_SERVER[‘HTTP_REFERER’]) ? $_SERVER[‘HTTP_REFERER’] : ”; if ( $prev_url ) { $prev_path = str_replace( home_url(), ”, $prev_url ); $page = get_page_by_path( $prev_path ); } That should give you the page object, where you can access it’s ID like so – $page->ID.

How do I get an external php page to load using javascript

If you’re trying to load a script from an external source (as your code suggests), please don’t use that article as a reference. It’s littered with bad code, and the comments on the page state several times that it’s outdated and points you to a new article. Here’s how you register and enqueue a script … Read more