Predefine Magazine Style Layouts

You can use a couple known plugins. TYPES and VIEWS, by wp-types.com. Please keep in mind that I am in no way, shape, or form affiliated with these plugins or plugin authors. Also, please note, the TYPES plugin is free, and the VIEWS plugin is premium. You will not be able to receive support for … Read more

Importing Concrete5 content to WordPress

If you go to WordPress’s Tools » Import page in your site’s Admin section (eg, http://example.com/wp-admin), you’ll find that it can import, among other things, HTML pages. So if you have a way to export your Concrete5 site to a directory of HTML pages, you should be able to import them that way.

SQL Database Lost

You should be able to restore the database by simply copying those files into the DB folder. (e.g., /var/lib/mysql/dbname). Typically there is a FRM file included as well.

SQL command to export post_content from wp_posts using phpMyAdmin

Use This Script <?php $servername = “localhost”; $username = YOUR_USER; $password = YOUR_PASSWORD; $dbname = YOUR_DB_NAME; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die(“Connection failed: ” . $conn->connect_error); } $a1 = ($_GET[‘id’]); $sql = “SELECT post_content FROM `wp_posts` where ID=’$a1′”; $result = $conn->query($sql); if ($result->num_rows > … Read more

Trying to insert a row from a Plugin

insert is not a static method. So you can’t call it like this: wpdb::insert(/*…*/). You’ll need to do something like: global $wpdb; $wpdb->insert(/*…*/); Or create your own instance: $db = new wpdb(‘dbuser’, ‘dbpassword’, ‘dbname’, ‘dbhost’); // change these! $db->insert(/*…*/);

cannot log in to the mysql server (wamp and wordpress)

The default Wamp user`s credentials are: username: root password: (empty, nothing, nada) If you already have a WordPress website previously created on your Wamp system, then go to /www/yourlocalsite/wp-config.php and check out the username and password you set. Here`s an example: /** MySQL database username */ define(‘DB_USER’, ‘root’); /** MySQL database password */ define(‘DB_PASSWORD’, ”); … Read more

How to display blog posts only authored by the administrator

Four changes to your script. Limit $users to users with ‘administrator’ role. Removed line if($user->caps[‘Administrator’]!=1) continue; as every user is an administrator. Changed ‘post_per_page’ to -1, to process all posts. Added wp_reset_postdata(); after each loop: $users = get_users( array( ‘role’ => ‘administrator’ ) ); foreach ( $users as $user ) { $query = new WP_Query( … Read more