question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I've noticed that my process is rather slow and i'd like to speed it up. I want to be able to duplicate my database from my domain which is blueharlequin.com and work locally thus speeding up the process. The reason I want to do that is because our website has specific loops that I cannot duplicate without knowing the ...
I will suggest Wordpress Duplicator , It is best tool for copying your site to any other host/localhost, and its free, I have used it many times and it works every-time with different server settings. Please note that I haven't affiliated with it in any way.
Duplicate domain database to local - How?
wordpress
In my post meta data I have the following 'key' for every post: "image_details" a typical value of which is an array such as: <code> a:3:{s:23:"info_window_bg_image_id";s:3:"128";s:12:"colour_start";s:7:"#000000";s:10:"colour_end";s:7:"#b7b7b7";} </code> In the above example - <code> info_window_bg_image_id </code> is ...
You have a structural problem with your data. Serialized data in the database is terrible if you need to search over pieces of that serialized data. There is no reliable, efficient, and certainly no easy, SQL query to search over serialized data. stackexchange-url (""serialization" is a PHP mechanism. It isn't SQL. To ...
How to count post meta key values for all posts in database
wordpress
With WordPress 3.9 coming soon it's bringing along TinyMCE 4.0. I'm running my plugins and functions through some testing and found that one of my functions seems broken / not working with the new tinyMCE <code> function myformatTinyMCE( $in ) { $in['theme_advanced_buttons1'] = 'bold'; $in['theme_advanced_buttons2'] = ...
The strings was new, not more for your requirements. This is the new content of the hook. <code> array ( 'selector' =&gt; '#content', 'resize' =&gt; 'vertical', 'menubar' =&gt; false, 'wpautop' =&gt; true, 'indent' =&gt; false, 'toolbar1' =&gt; 'template,|,bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignle...
WordPress 3.9 - Trouble Editing new TinyMCE
wordpress
Editors note: Twitter ID and Google Analytics only serve as examples and are exchangeable. TL;DR I want to save external data in a user profile once or twice a day. I added two custom fields in my user profiles: Twitter_ID (I manually put it from the dashboard) test1 (external data got with php function) I would like t...
An alternative way to do what I wanted : Save the time when the action has been ran and check the difference with actual time : <code> function my_save_statistiques( $user_id ) { $user_id = get_current_user_id(); $current_time = time(); if (empty($current_time)) { update_usermeta( $user_id, 'last_analytics', $current_t...
WP Cron: Save third party data as user meta
wordpress
I have a WordPress install on a dedicated server with decent memory (upwards of 8GB). The WordPress install includes many plugins - 50 active plugins. Most important to note is the WPML plugin to make WordPress multilingual. The theme is Weaver II Pro . The stack is LAMP - CentOS 6.3, Apache 2.4.4, Percona MySQL, PHP-F...
Fixed this by setting max_allowed_packet = 16M in my.cnf and restarting mysql
"MySQL server has gone away" since update to 3.8
wordpress
If I want to create a link that will always show the latest post how can i do that? Lets say I have three post types and there is three lists with posts names likes a nav list to those post types. How do I make it dynamic? I can't make it like this blah.com/post Because it always will be always changing.
If I understand well you want to show the last post (one post) from one of the 3 post types you have, using a dynamic url like <code> http://example.com/latest </code> . First of all lets add a filter to <code> 'do_parse_request' </code> filter: <code> add_filter( 'do_parse_request', function( $bool, WP $wp ) { $home_p...
How do I create a link that will always show the latest post?
wordpress
I am using horizontal-scrolling-announcement plugin to announce a news bellow the header.I have added some custom code to hide scrolling news announcement at one event if the admin change the status display no and its working .Before the customize the plugin if i set the status display no it was scrolling news with tex...
i just wanted know that how can i update the plugin without overwrite the my previous custom code. You don't. Well, you do the same thing over and over and over again every time you want to update. Download the plugin. Hack your changes into it. Upload to your site. Repeat. Which is why you don't edit plugins that you ...
How to update plugin without overwrite custom code
wordpress
I followed the beginner steps for creating a child theme . The child theme was created and it appears as an option on my Themes page. But unlike the other Themes on the page (including its parent), there is no preview. The other themes ("Twenty Twelve," "Twenty Thirteen," and "Twenty Fourteen") are all listed with an i...
Unfortunately this isn't covered in that codex page. These previews of the themes aren't auto generated. You will need to take a screenshot of your theme, and upload that screenshot to your root folder as 'screenshot.png'. This screenshot will be automatically used then as a theme preview pic for your theme. I quote fr...
Child theme preview missing
wordpress
I have this code: <code> &lt;?php // List subcategories of category '4' $subcategories = get_categories('&amp;child_of=4'); foreach ($subcategories as $subcategory) { echo sprintf(' &lt;a href="%s"&gt;%s&lt;/a&gt; &lt;span class="sep"&gt;•&lt;/span&gt;', get_category_link($subcategory-&gt;term_id), apply_filters('get_t...
Here is a function I've recently used (modified version of the code found in the codex) to display a list of the categories a post is attached to. This function first gets the parent category to which the post belong, and that info is then fed back into <code> wp_list_categories </code> to remove the parent category an...
Display a list of subcategories a post belongs to
wordpress
I have some questions about the loop. I'm using "twentyfourteen" theme as an example. I'm creating 2 php files with basic loop. One is home.php, and one is a template page called sample-page.php . Both contains this code; <code> if( have_posts() ) : while( have_posts() ) : the_post(); the_content; endwhile; endif; </co...
This quite a broad question to answer. I'm not going to go into detail here and into core code, you'll need to go and read the links I'm going to provide. I'm going to try to keep my answer sweet and short and useful :-) Take the bundled theme twentyfourteen for example, when you open any page template, you'll find thi...
The Loop in Static Page
wordpress
I've created a simple loop. And I have the following array for the query: <code> $live_tags = array( 'tag' =&gt; 'live', 'showposts' =&gt; 5, 'post_type' =&gt; 'post', 'post_status' =&gt; 'publish', 'orderby' =&gt; 'date', 'order' =&gt; 'DESC' ); </code> Where it says <code> 'tag' =&gt; 'live' </code> , I need a logic ...
You need a <code> tax_query </code> . <code> $live_tags = array( 'posts_per_page' =&gt; 5, // showposts has been deprecated for a long time 'post_type' =&gt; 'post', 'post_status' =&gt; 'publish', 'tax_query' =&gt; array( 'relation' =&gt; 'OR', array( 'taxonomy' =&gt; 'post_tag', 'field' =&gt; 'slug', 'terms' =&gt; 'li...
Retrieve all posts within tag OR category?
wordpress
I found several plugins (like this one and this one ) to get the ability to attach a picture to a WP user. But these plugins are not maintained any more. Since there's apparently no plugin that does it today, is there an easy way to do it manually?
I use a plugin called Avatar Manager for that function. The author has also done a tutorial on how to write your own avatar manager plugin, but unfortunately it is also a bit outdated and doesn't work anymore. Although the plugin states it is compatible up to 3.6.1, it is still working in 3.8.1. I know at this stage th...
Adding a photo to each WP user
wordpress
Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple taxonomies instead of displaying all results that meet 1 of the tax. New question has been made. <code> &lt;?php function pa...
Per the Codex: relation (string) - The logical relationship between each inner taxonomy array when there is more than one. Possible values are 'AND', 'OR'. Do not use with a single inner taxonomy array. So you are on the right track, but your <code> tax_query </code> is wrong. <code> relation </code> is part of the out...
relation OR instead of AND - Filtered term ID's in loop
wordpress
I'm using the <code> transition_post_status </code> hook to perform some operations after publishing a post. In some conditions I would like to show an error message in a red box under "Edit Post" and above "Post published": How can I do that?
I wouldn't use that hook. Here's why Try something like this using admin_notices . <code> function wpsites_admin_notice() { $screen = get_current_screen(); if( 'post' == $screen-&gt;post_type &amp;&amp; 'edit' == $screen-&gt;base ){ ?&gt; &lt;div class="error"&gt; &lt;p&gt;&lt;?php _e( 'Updated Demo Message!', 'wpsites...
How to show an error message after publishing a post?
wordpress
I am building my website on Wordpress and I have created my custom login page.But for a post when an user comments and other nonlogged see the comment with along with a line down "Login to reply".And when the user clicks on that"Login" from "Login to reply" it redirects to wp-login.php.So how to redirect users to custo...
You need to redirect everytime WordPress looks for <code> wp-login.php </code> . You can do the same by using the below in your active theme's <code> functions.php </code> file. <code> function redirect_login_page(){ // Store for checking if this page equals wp-login.php $page_viewed = basename( $_SERVER['REQUEST_URI']...
how redirect users to custom login page when "login to reply" is clicked?
wordpress
I am using this template: http://demo.undsgn.com/studiofolio/front-page/ I tried to make some modifications because I need the homepage template to display an excerpt beneath each thumbnail. I copied the template called <code> front-page.php </code> , renamed it to <code> front-page-excerpt.php </code> and made my modi...
No idea why you're using clunky custom SQL, use a meta query instead. <code> $pageposts = get_posts( array( 'posts_per_page' =&gt; -1, 'post_type' =&gt; 'page', 'post_status' =&gt; 'publish', 'meta_query' =&gt; array( array( 'key' =&gt; '_wp_page_template', 'value' =&gt; array( 'templates/front-page-excerpt.php', 'temp...
Query multiple meta key values for template
wordpress