question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I'm using WordPress as a directory site, where a user can submit a post, which becomes their ad/listing. The users are assigned a custom wordpress role. Posts need to need to be approved and published by the admin once, and then they can freely update their post as they see fit. It work's fine like this at the moment b...
Thanks to Chris's suggestion of assigning a capability on the fly I was able to get something working that might help someone else. There may be a better method, but this one works well for my situation. Because I'm working with a custom post type of <code> listing </code> I needed to assign the mapped capability <code...
How to allow a user to make their post (ad) a draft, and then publish again without needing approval?
wordpress
I have a Wordpress site in which the background color is black and the text is white. The site is fine, but it's a pain trying to edit content in the visual editor as the background is white (same color as the text). I end up having to tell users to use the HTML view or write up the content in black color text and then...
similar to the answer by GavinR, using the wordpress <code> add_editor_style() </code> function; (as implemented in Twenty Ten and Twenty Eleven) in functions.php of your theme, add: <code> add_editor_style(); </code> then create an editor-style.css in your theme folder: <code> .mceContentBody.wp-editor { background-co...
How do you change the visual editor's background color?
wordpress
How can I limit the amount of results returned? <code> $images = $wpdb-&gt;get_col(" SELECT ID FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND ID in ($meta) ORDER BY menu_order ASC "); </code>
<code> $images = $wpdb-&gt;get_col(" SELECT ID FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND ID in ($meta) ORDER BY menu_order ASC LIMIT 5 "); </code> Like @Kaiser suggested you can specify a range (5th to 20th results, a total of 15 results are returned at max) like this: <code> $images = $wpdb-&gt;get_col("...
Limit amount of results returned
wordpress
Im using this code to prevent duplicate post from being added but i also need to prevent duplicate pages too. Can Someone please help? <code> function clearDuplicatePosts(){ global $wpdb; $prefix = $wpdb-&gt;prefix; $wpdb-&gt;query("DELETE bad_rows . * FROM ".$prefix."posts AS bad_rows INNER JOIN ( SELECT ".$prefix."po...
you can use the same function simply hook it to the <code> publish_page </code> hook or any custom post type for that matter <code> publish_{post type name} </code> so just add : <code> add_action('publish_page', 'clearDuplicatePosts'); </code>
Prevent duplicate pages from being added
wordpress
How to check if jQuery library exist in head tags? <code> &lt;head&gt; &lt;script type="javascript/text" src="http://code.jquery.com/jquery-1.6.2.js"&gt;&lt;/script&gt; &lt;/head&gt; </code> and if not exist how do I load in head tags the jquery library, I'm doing a plugins and I want to load my plugins script in jQuer...
scripts and styles should never be embedded directly in themes or templates because of potential conflicts between plugins and themes. To use jQuery in a plugin or theme it should be enqueued with wp enqueue script . This will make sure it's added only once, and any scripts that define it as a dependency will load afte...
Check if jquery library exist
wordpress
I have change the main URL of my wordpress theme. I accessed <code> Admin area =&gt; Settings =&gt; and change my URL from : www.sampleURL.com to www.sampleURL.com/?page_id=2 </code> and now every time I enter <code> www.sampleURL.com/wp-admin </code> i get directed to <code> www.sampleURL.com/?page_id=2 </code> Please...
Not sure why you would want to make that change, but if worst comes to worst, you can change it back via the database. Assuming you can access your MySQL database directly, simple navigate to the wp_options table and change the value of <code> siteurl </code> and/or <code> home </code> to your desired values. EDIT: Alt...
I can't access my admin page after changing main url
wordpress
I have a site visibility in privacy settings set to allow search engines to see my site but for some reason when i go to the auto generated robots.txt file it shows User-agent: * Disallow: switching site visibility merely adds/removes a trailing slash ie "Disallow: /" i have 2 related plugins "all in one seo tools" and...
Disallow with no trailing slash is the same as "allow all" - see here - nice find!
auto generated robots.txt problem
wordpress
We have a large wp install that is freezing up whenever an editor hits "publish". It seems that the culprit is the pinging processes that run, such as re-building the sitemap, etc. Is it possible to move most of these processes to the background so that the site doesn't hold up until the processes are complete?
Pinging and similar is all done in the background already. If you have a plugin rebuilding a sitemap or something, then consider using a different plugin which doesn't have the same rebuilding time issue.
How to move post process to background
wordpress
Given a wordpress multisite network, with a main blog, and assuming all content has been moved on to that blog, how would one collapse the network back down into a standard wordpress non-network non-multisite install?
I've gone through the steps to extract a site from a multisite install to a single instance now: Set up a clean copy of WP but don't install it Find the site ID Copy the files from blogs.dir/ID/files to the new WP uploads folder Copy the theme the site uses and any plugins it uses to the appropriate folders in the new ...
Convert a Multisite Wordpress install into a Single site
wordpress
I was making minor changes to <code> functions.php </code> file but just as I made the changes I got an error, I used <code> FileZilla </code> and undo the function I added but now I am getting the following error, Fatal error: Call to undefined function add_action() in /home/content/93/7877293/html/wordpress/wp-includ...
You're not supposed to edit <code> wp-includes/functions.php </code> but <code> wp-content/themes/your-theme/functions.php </code> .
Error after editing functions.php
wordpress
example page; http://www.c-art.org.uk/2011/07/01/jenny-abbot/ some reason the gravatar image is overwriting the posts featured image thumb (100x100). Nnot sure how its doing it! How can i get rid of it? <code> &lt;meta property="og:title" content="Jenny Abbot" /&gt; &lt;meta property="og:description" content="C-Art — C...
I can't see a Facebook share button on the page you are talking about , but I ran this through Facebook Lint and it appears that your Open Graph meta tags are working correctly.
open graph image being overwritten by gravatar logo?
wordpress
Uploading an image to add to a page, I got a message saying: Unable to create directory... Is its parent directory writable by the server? Assuming the issue is that the parent directory needs to be made writable by the server, how do I make the parent directory writable by the server? Thanks, Richard
Here is how to change your folder permissions. Login to your ftp Make your wp-content folder 755 (In most FTP programs, this involves right-clicking -> "Permissions"). 755 is owner: read, write and execute permissions; group: read and execute permissions; others: read and execute permissions. Inside wp-content create a...
Making a parent directory writable by the server
wordpress
How can I list all pages within a certain parent (ID=917) and show the month and year they were published in this format: Aug 2011 This is a page (link to page) This is another page (link) Jul 2011 Jun 2011 This is another page (link) etc etc UPDATE: Also, just in case, how can I just show the months that have a page w...
Ok firstly, create a php file inside your theme's folder and give it a name that won't clash with any of the native theme template files, archive.php, index.php etc... (give it a unique name, something like page-list-by-month.php ). Add the following code to that file. <code> &lt;?php /** * Template Name: Pages by Mont...
List pages within a certain parent and show published month
wordpress
In theme Twenty Eleven, do the default images rotate randomly, or with some sequence? As far as I can see, I think it's random, but there might be some pattern/sequence that I didn't notice.
the header image is picked at random; see this line in /wp-includes/theme.php line 1476: <code> $random_image = array_rand( $headers ); </code> out of interest: why are you asking, and what difference would it make?
In theme Twenty Eleven, do the default images rotate randomly?
wordpress
I'm facing a design, that has two titles. I have no clue how can I two titles in wordpress. In a nutshell: Creating a page, there you can set the title. How can I have two titles there? Or similar effect?
Strictly speaking title is column in posts database table so it is not easy (or makes sense) to add one more title. But it is trivial to emulate by using custom field to store additional title (or anything else).
How can I have two content titles?
wordpress
The Puzzle: I am currently working on a music blog that has various venues and numerous locations that are laid out at the top of each post as follows: USA.California.Los Angeles. Hollywood Bowl Note: Everything except the venue name (Hollywood Bowl) is bold. In order to limit the number of calls to the server I have c...
To are still call database inside the by <code> get_post_meta() </code> where you already have the values in <code> $custom_fields </code> variable. Try something like this: <code> &lt;?php $custom_fields = get_post_custom($post-&gt;ID); for ($i = 1; $i &lt;= 4; $i++) { if(isset($custom_fields["rw_location_$i"][0])){ i...
PHP Puzzle: Unique Styles with PHP loop
wordpress
Setting up WordPress, I'm getting the following message: "Sorry, but I can't write the wp-config.php file. "You can create the wp-config.php manually and paste the following text into it." Do I copy-paste the text into a file and upload that to the server? If yes to question 1, to create the file, is Text Wrangler an a...
Here is how you make your config.php manually: In your download there should be a wp-config-sample.php. Open this is a text editor. Fill in your database connection details. Go to https://api.wordpress.org/secret-key/1.1/salt/ and get the code. Copy the above cope and paste into the sample file over the top of the exis...
Creating the wp-config.php file manually
wordpress
With the current version of wordpress 3.2.1 I am having this kinds of problem. I install wordpress frequently and I did not notice it before 3.2.1 Problem: Not being able to save settings under settings tab. The file names are <code> options-general.php </code> , <code> options-writing.php </code> , <code> options-read...
On my observations. This is happening for only low speed users. When I tried from broadband the problem i seems to get away.
Problem saving wordpress settings with current version. Is it a bug?
wordpress
I've created a twentyeleven-child theme and activated it. I'm trying to increase the size of the body font on all pages. Do I do this in style.css of the twentyeleven-child theme? I can't find the right font in this file to change. In attempt to find it, I've searched all 10px, 11px, 12px, 13px, 14px, 15px, and 16px an...
The body font size in TwentyEleven is listed on line 316 in style.css <code> body, input, textarea { color: #373737; font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; line-height: 1.625; } </code> Copy it over to your child theme style sheet and change the 15px to 20px. If you have already do...
Modify Twentyeleven child theme CSS - How to change body font size?
wordpress
Is it possible to change the Home page so it's not a blog, but a page? And also is it possible to change the name of the homepage? If yes, how is this done? Thanks, Richard
To change the site Front Page to be a static Page : Go to <code> Dashboard -&gt; Settings -&gt; Reading </code> Change Front page displays from Your latest posts to A static page In the dropdown beneath this option, select the static Page to use as your Front Page. If you want to display your blog Posts somewhere, sele...
Changing the homepage
wordpress
Is there a way to set a url for a page, as per the following example: I want to change this url: http://richardclunan.com/?page_id=2 To: http://richardclunan.com/copy-critiques Is this possible? (I clicked Permalink Settings and specified 'copy-critiques' as Category Base, but this didn't do the trick...) Thanks, Richa...
you can set the permalinks to <code> %postname% </code> , however this would change the permalinks for the whole site; and you can set the individual page permalink, which is normally derived from the page title, when you edit the page. btw: pages don't have a category base.
Setting a url for a page
wordpress
How can I change the ordering of menu items -- for example to make 'Wordfruit Copywriters' appear before 'How can you sell more of your product?' here: http://richardclunan.com/ Thanks, Richard
Go to appearance -> menus section. Here you can create menus, add menu items and drag them around to place it to your desired place. Alternatively, you can set up the menu order of a page. Just click edit page and you will see the menu order it should be under Page attribute section.
How to change order of menu items
wordpress
Do different themes accommodate different features, or can all themes accommodate any feature? I.e. do I need to bear in mind what features I'll need when I choose a theme, or are themes only how things are laid out visually? Also, is it possible to change the image in the default theme 'Twenty Eleven'? Thanks, Richard
No, not all Themes accommodate all features; but to answer that question more precisely, you'll need to be more specific about what you consider to be "features". Things that are generally considered Theme features are fairly well-represented by the list of filter tags for WORG repository-hosted Themes . You'll notice ...
Do all themes accommodate all features?
wordpress
This website: http://www.ericpaulsnowden.com (The website is done in Wordpress). Loads pages and posts dynamically with AJAX/jQuery. Does anybody know how to do this?
I do, it's my site :) Here it is at a high level 1) I built the site as a standard html/css/javascript site without ajax and without Wordpress code. Layout complete without content. All links are regular a href links - this helps with backwards compatibility later. 2) Added in the Wordpress code to pull in content with...
How to load whole Wordpress pages dynamically with AJAX/jQuery like this following website?
wordpress
I have a non-Wordpress site , www.example.com For canonicalization purposes I have this in .htaccess : <code> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L] </code> This way all non-www links will be redirected to www version o...
As per @Milo, I'm adding my comment above as an answer... Try going to <code> example.com/blog/wp-admin/options-permalink.php </code> . That should work, because the php file actually exists. If so, try updating your permalink options to a friendly version, like "Day and name". This will put a new <code> .htaccess </co...
New installation can't be found due to htaccess of the original non-Wordpress site
wordpress
I want to add a list of my social media pages. What ways are there to do this? Are there widgets designed for this?
There are a couple of ways to do this. You can do as Chris Carson suggested and manually add them as a text menu. You can also make a text widget and use icons with links to the various services. If you're looking for something a little more robust, there's also a couple plugins and related services, such as AddThis, t...
Adding a list of social media links
wordpress
We created a theme that has a lot of changes in it. Now we want to enable that theme on our site in different colors, and a few images different: What we're doing is duplicating the theme, and then making a few changes in the CSS, and change a few images. But it seems an overkill - to copy the all the theme files just ...
We ended up using child themes, mainly because the site manager wanted to get a preview of the color change that would occur when changing CSS, and that was done best by the theme switching page , but also because it was easier...
Theme change only in CSS and a few images
wordpress
Is it possible to change the image in the default theme 'Twenty Eleven'? If yes, how is this done?
Just replace the default header image, under images/headers/path.jpg in your theme folder.
Is it possible to change the image in the default theme 'Twenty Eleven'?
wordpress
how can achieve this functionality. That I can change the themes "slogan" from admin and I don't have to go edit the themes source files. I think that there is some theme options functionality. But how to use it and maybe somebody can point me to the correct path. Added screenshot to clarify what I mean under slogan:
In wordpress that's a tagline.. maybe a plugin like this http://wordpress.org/extend/plugins/advanced-tagline/ can help you.
How to dynamically change theme's slogan from admin?
wordpress
if i follow the tutorials on how to add tinyMCE buttons for shortcodes ( for instance: http://www.garyc40.com/2010/03/how-to-make-shortcodes-user-friendly/ ) if i create a button that launches a form in a thickbox there is always this bit of code to create the launched form: <code> // executes this when the DOM is read...
by using jQuery.ajax() : so, instead of that big form variable: <code> $.ajax({ type: 'GET', url: 'admin-ajax.php', data: { action: 'get_my_form' }, success: function(response){ var table = $(response).find('table'); // you don't seem to use this "table" var $(response).appendTo('body').hide(); // ... } }); </code> Now...
TinyMCE buttons that launch Ajax-generated forms
wordpress
Basically I want to rewrite: /edit/test-post to an existing page with a parameter: /edit?e=test-post From the examples in the Codex I created: <code> add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' ); add_filter( 'query_vars','my_insert_query_vars' ); add_action( 'wp_loaded','my_flush_rules' ); // flush_rul...
By 'existing page' do you mean a WordPress page? My experience with rewrites is routing everything to index.php with whatever extra query vars you need, I think attempting to route it to <code> edit </code> is one of your issues, not entirely clear on your intent there. Go download Monkeyman Rewrite Analyzer if you don...
Can't get rewrite rules working
wordpress
I've downloaded WordPress and I want to ensure I'm uploading it to my server correctly: I see there's a .zip file and a .tar.gz file -- which should I use? It's an Apache server. This is the place my site will be: http://plowtoplate.com/ I want the site to be at http not at www., but I do want either the site to also b...
WordPress Codex has quite extensive installation instructions . I see there's a .zip file and a .tar.gz file -- which should I use? No difference. Archive format is merely for convenience, contents are the same. I want the site to be at http not at www., but I do want either the site to also be visible at www. or for t...
Basic installation questions
wordpress
I want to specify for the images of my post - if is number x, output this, else if is number y output this instead, etc. I'm trying make specific treatments to my 1st, 4th, 9th images for that post. This code below is the code i'm using to just simply output all of my images for the post. Any ideas? <code> &lt;?php $im...
set a counter variable outside the foreach, check its value in each iteration and output corresponding markup, then increment it at the end for the next iteration. <code> &lt;?php $images = get_post_meta($post-&gt;ID, 'rw_postpage_images'); // set a counter $image_counter = 1; foreach ($images as $att) : $src = wp_get_...
Specify what to do for a specific image number of the post
wordpress
When doing a bit of Google searching for content on our blog, I noticed to my shock and horror that individual images from the Media Library are somehow generating their own URLs that Google is somehow finding and indexing! For example this page: stackexchange-url ("http://blog.stackoverflow.com/2008/08/special-develop...
This thing you are saying is unwanted is just normal functionality under WordPress and it cannot be removed. However there are things you can do to point the unwanted URL to something more usefull. Here is a forum post on this issue with some interesting fixes and a description on what is happening: http://wordpress.or...
Unwanted media library URLs in posts?
wordpress
I've been searching for a better way to utilize the built in Thickbox function for images. I've been using my method for a few months, but I don't think it's the best way to do it. Here is the code I've been using (I don't remember where I found the code or I'd link to the article): <code> &lt;?php if (!is_admin()){ /*...
What if you try adding this to your functions.php <code> function tb(){ wp_enqueue_script('thickbox',null,array('jquery')); wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); } add_action('init','tb'); </code> and keeping your bit of jQuery (not sure what your are needing those php va...
Howto use WP built in Thickbox for images?
wordpress
From the past few weeks I am noticing that when I share my posts on facebook, the thumbnail is not coming, I am keeping a featured image for my posts, but when I share it on facebook it shares the link without thumbnail, I tried using several code which I found on google, but none of them works. I am using twenty eleve...
You need to add Open Graph meta tags to your <code> &lt;head&gt; </code> . See <code> og:image </code> below... <code> &lt;meta property="og:title" content="35% of LinkedIn Users Check The Site Daily" /&gt; &lt;meta property="og:type" content="article" /&gt; &lt;meta property="og:url" content="http://therealtimereport....
Facebook Share Thumbnail
wordpress
A site that was working fine previously is now getting an error, <code> Error establishing a database connection </code> I have dealt with this error while creating new wordpress sites(when there was something wrong with the <code> config </code> file). This time, the error occurred when the user upload a file to <code...
Did you checked your wp-config.php file? Is database name or password is changed? wp-config.php file is located on the root directory you installed wordpress. Open the file and you will see database password, username etc that wordpress use to connect your database. Check the username, passwords are correct. <code> /**...
Error establishing a database connection error on a site that was working fine previously
wordpress
Okey guys, I am little confused here. I am building a ads rotating site (specifically for jpgs/gif banners) for my client where people can add banners and create code to put in there site. My Plan So Far: Individual Ads will be a custom post type. Each ads will have a specific banner size. Ads Group: A group of ads whe...
Meta for taxononmies is not available out of the box, you need to create separate database table for Metadata API to work. If size is the only extra data you need and that is not going to change I'd try to use term description to hold it. Otherwise you are better off with CPT or something custom and simple.
Help need making decision. Ads rotating site on wordpress
wordpress
I have an array saved in postmata, each array key become a metakey. I want to change the code to save the whole array with one metakey. How to do that? Thanks! <code> $poddata = Array( 'pod_id' =&gt; $this-&gt;pod_id, 'url' =&gt; $this-&gt;url, 'name' =&gt; $this-&gt;name, 'description' =&gt; $this-&gt;description, 'se...
you don't need to loop through the values. Just use update_post_meta($post_ID, {key}, {array of vals}), it would do! <code> &lt;?php $poddata = Array( 'pod_id' =&gt; $this-&gt;pod_id, 'url' =&gt; $this-&gt;url, 'name' =&gt; $this-&gt;name, 'description' =&gt; $this-&gt;description, 'service' =&gt; $this-&gt;service, 's...
How to save an array with one metakey in postmeta?
wordpress
I have been searching for some time on how to modify the Widgets Administration Screen, i'm attempting to add the sidebar id to the wrapper elements. Current output: (produced by wordpress) <code> &lt;div class="widgets-holder-wrap"&gt; </code> Desired output: <code> &lt;div id="sidebar-id-here" class="widgets-holder-w...
I'd personally suggest an enqueue, it's preferable where possible to make use of caching and script compression. Firstly, the enqueue. <code> add_action( 'admin_enqueue_scripts', 'add_sidebar_ids_to_widget_admin' ); function add_sidebar_ids_to_widget_admin( $current_page_hook ) { if( 'widgets.php' != $current_page_hook...
Modify WordPress widgets Screen
wordpress
I want to create 2 new sites. One will be a simple site with a few pages -- not really a blog, but I might add a blog to it at some point. The other site will be more like a blog -- with guest posts by a number of people, and it will probably have affiliate links -- possibly Amazon links. It might also have Google Ads,...
WordPress can do anything you mentioned. However your question is bit too generic to be sure about anything.
Is Wordpress a good option for this...?
wordpress
Is there a PHP function that will return an array of all of my uploaded images? Or, failing that, how bout just my uploaded files? The end goal is to display a slideshow on my homepage: have it rotate through each image, one at a time. Almost like an animated gif, in an infinite loop/cycle.
uploaded files are stored as attachment post type in WordPress. Use get_posts() and query for all attachments: <code> $args = array( 'post_type' =&gt; 'attachment', 'numberposts' =&gt; -1, 'post_status' =&gt; null, 'post_parent' =&gt; null ); $all_attachments = get_posts( $args ); </code> EDIT - you can also set <code>...
Is there a function to list all uploaded images? How can I add one?
wordpress
Is there an argument to define how many posts ago will be displayed in "recent" posts. Could I add something to this and define a specific number of posts ago to start the loop? <code> $args = array( 'numberposts' =&gt; '5' ); $recent_posts = wp_get_recent_posts( $args ); </code> So for example I have a page of archive...
<code> wp_get_recent_posts </code> basically uses <code> WP_Query </code> , so you can use the <code> offset </code> parameter. So something like, <code> $args = array( 'numberposts' =&gt; '5', 'offset' =&gt; 5 ); </code> Reference: http://codex.wordpress.org/Class_Reference/WP_Query#Offset_Parameter
Show recent posts starting at a specific number archive
wordpress
I'm trying to create a new user after someone fills out a form. I'm using <code> wp_create_user </code> to do so. A user is being created properly, but, for whatever reason, no password is being submitted to the <code> users </code> table. It's simply a blank value. First of all, I should note that, unfortunately, for ...
PHP support variable-lengths argument lists . Simply put you can pass as many additional arguments as you want to any function and PHP won't even blink. If you look at the source of <code> $wpdb-&gt;prepare() </code> method it simply fetches all arguments with <code> func_get_args() </code> into variable and works with...
wp_create_user not properly entering password
wordpress
Is there a way to select and display the last X approved comments regardless of which posts or categories they belong to ? I just want to show on my home page the last comments added on my site, but I can't find anywhere how to do that.
A slightly more complete and less abrupt answer. <code> &lt;?php $args = array( 'status' =&gt; 'approve', 'number' =&gt; '5' ); $comments = get_comments($args); foreach($comments as $comment) : // display any of the following indexes as you'd like var_dump($comment); endforeach; ?&gt; </code>
Display last comments on home page
wordpress
I have a blog which uses custom post type 'aside' for aside posts. Now that wordpress has custom post formats, I want to use the 'aside' post format instead. Is there a way to convert post typess to post formats? I'm looking for code/tool similar to wordpress's in-built tool which lets one convert from categories to ta...
There are a couple of plugins available that will allow you to do this. http://wordpress.org/extend/plugins/post-type-convertr/ or http://wordpress.org/extend/plugins/convert-post-types/ should get the job done for you.
How does one go about converting custom post type to post format?
wordpress
I would like to remove screen options and help links in my admin area. How to remove that thing?. This is what i want to be removed. Thanks.
There are several plugins that can do that: Adminimize , you can remove it even on role base Admin Trim Menu
How to remove screen options and help links in the admin area?
wordpress
On my website http://filmblurb.org , all the posts and everything on my home page are missing. Can you anybody tell me how to fix this? Thanks! (If it helps, I'm using Wordpress 3.2.1.)
I cannot see any missing content. Are you sure you weren't just having server issues at the time of posting this? Did you check it in other browsers? Having said that, this is not a real question and I have voted to close.
Why is my content missing from homepage?
wordpress
I'm currently developing a plugin and the chances are that I will more than likely release it on the public plugin repository so others can use it. The plugin will be using an API and to use this API you need to pass a username and password. So my plugin needs to store these login credentials in the database. I don't w...
While I agree with the previous answers, to answer the question you actually asked, what comes to mind is to use one of these constants for wp-config.php: define('AUTH_KEY', 'redacted'); define('SECURE_AUTH_KEY', 'redacted'); define('LOGGED_IN_KEY', 'redacted'); define('NONCE_KEY', 'redacted'); They are meant to be uni...
How to store username and password to API in wordpress option DB?
wordpress
i need to filter count based on a date and post_status = 'publish', how to write a query to filter, as far as now i have filtered based on date, what is the query need to filter based published post. $table1 = $wpdb-> prefix.'posts'; $sql = 'SELECT COUNT(ID) AS count FROM '.$users_table1.' WHERE DATE(post_date) &lt; "'...
You can add this to the WHERE clause, just after your filter by post_date: <code> AND post_status = "publish" </code>
query for filtering published posts?
wordpress
I have set a page to be password protected in the admin, but for some reason WP is not asking for the password when viewing the page. It definitely isn't a plugin as I have confirmed the behaviour with the plugin folder renamed. I have been testing it in Chrome w/incognito. The page is using a custom template, which ma...
The answer to this question was simply that the built-in password protection does not apply if you are using a custom template that doesn't include <code> the_loop() </code> . Lesson learnt.
Password Protected page not asking for a password
wordpress
I'd like to be able to enable/disable plugins on a per-site basis in multisite, similar to the way that themes are per-site configurable. Is this currently possible? (For instance, I don't particularly want people seeing the Domain Mapping plugin but want them to be able to enable Gravity Forms.)
Multisite Plugin Manager The essential plugin for every multisite install! Manage plugin access permissions across your entire multisite network.
Can I enable/disable/hide plugins on a per-site basis in multisite?
wordpress
Sometimes it's nice to have admin on a different host (admin.mysite.com) then the actual site (www.mysite.com). If admin.mysite.com is not publicly accessible, then images attached to posts on admin.mysite.com will not be accessible on www.mysite.com since the url to the attached image is absolute and contains the doma...
I found another way of doing this. I added the following to functions.php: <code> function yoursite_get_relative_attachment_path($path) { $paths = (object)parse_url($path); return $paths-&gt;path; } function yoursite_wp_handle_upload($info) { $info['url'] = yoursite_get_relative_attachment_path($info['url']); return $i...
Having admin on different host breaks attached images
wordpress
A new site i'm making is going to use extensive use of the categories, so here's what i'm trying to accomplish: Main Category Name (Link) List of Sub Categories (All Links) When i'm on a sub-category page I want it to look like the Main Category page just with the sub-categories highlited. Is that possible?
That's damn simple, see here: http://codex.wordpress.org/Function_Reference/get_categories . The sample downhere should work: <code> $kids = get_categories(array('child_of'=&gt;get_query_var('cat'))); </code>
Printing out Category and all Category Children on category.php
wordpress
took a look at the questions but I couldn`t find a similar one. I need to change the custom error messages that are displayed when user tries to login with a wrong username or password. Like, change this: " ERROR : The password you entered for the username %1$s is incorrect. Lost your password?" to this "Wrong informat...
you can do that using <code> login_errors </code> filter hook and here is how: <code> add_filter('login_errors','login_error_message'); function login_error_message($error){ //check if that's the error you are looking for $pos = strpos($error, 'incorrect'); if (is_int($pos)) { //its the right error so you can overwrite...
Change login error messages
wordpress
I am trying to run a script when a user publishes / updates a post. I am using the filter: wp_insert_post_data The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but th...
It looks like it could be because the filter cannot find the include file. Try using: <code> include( ABSPATH. "/path/to/file/jobsfeed.php" ) </code>
run script on publish
wordpress
I want to allow commas in tag names? For example, <code> "hello, world" </code> or <code> "portland, or" </code> but Wordpress keeps separating them. I can do it from the categories page: And it shows up fine. But anything added from the posts sidebar does not show up ok here: There is some discussion on it here: http:...
No core hacking needed -- thanks to: HOOKS. Hooks allow to fix the issue with a nice combination of a filter replacing "--" by ", " before output and an "if" loop to make sure the output is not also filtered for the admin interface :) and finally you, saving all your tags with comma in the format "Fox--Peter" instead o...
How can I allow commas in tag names?
wordpress
Is there a way to import users from another wordpress site? Both sites are new. I just don't want to go through the trouble of adding the same users profile information and password.
I think you have two options (third if you find any plugins). I think if you export data from one WP, the users are also copied. The drawback is that you have to import all the content as well. The second option is to export the users from MySQL using PHPMyAdmin. Just export the user table. If you want to include privi...
Importing users? From another wordpress site
wordpress
I am developing WordPress plugin.This plugin has own login system.Which means users can register into the system. Then they can login. if the user login, i want to redirect them to their own profile page.This page should not be accessible while user is in logout or plugin is in inactive.So how can i create page through...
If the page needs to be added and available on the front end, you can use wp_insert_post() to create the page, the use a conditional to only display it if the user is logged in: <code> if(is_user_logged_in()) { // display content } </code>
How can i create page through plugin
wordpress
I'm trying to use the function get_the_tags() from outside the 'loop'. I understand this can be achieved by using the post ID like <code> get_the_tags($postID) </code> . Does anyone know how I can get the post ID from inside a wp_insert_post_data function? I've tried using 'guid' which is suggested here , although I've...
In the following, '10' is the priority that <code> my_func </code> gets called and '2' is the number of arguments that <code> my_func </code> accepts. The latter is important , since the <code> add_filter </code> function defines the default as 1, but the <code> wp_insert_post_data </code> filter hook sends two argumen...
Getting post id from wp_insert_post_data function?
wordpress
I have a form that creates a new user by using: <code> wp_create_user() </code> This works, but after this I want to auto log in the user. I tried using: <code> $creds = array(); $creds['user_login'] = 'username'; $creds['user_password'] = 'password'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( ...
Here is a function I wrote that hooks into the gravity forms create user form but it can be added to whatever action hook your wp_create_user function is attached to. <code> function my_auto_login( $user_id ) { wp_set_auth_cookie( $user_id, false, is_ssl() ); wp_redirect( admin_url( 'profile.php' ) ); exit; } </code> T...
Set user after wp_create_user?
wordpress
I'm employing custom widgets for my client because it's easy and they have several menus they need to create specific to site sections. I then want to allow them to add to the custom menu dynamically using widgets (I create the spaces needed for the widget and they drag and drop the menus into that widget bucket). I tr...
if you want to show the menus only on child pages then you need to change your conditional statement: <code> global $post; //only on children of 269 if ('269' == $post-&gt;post_parent){ //menu for Sport &amp; Fitness pages ?&gt; &lt;div id="seventh" class="widget-area" role="complementary"&gt; &lt;?php dynamic_sidebar(...
Custom Menus, Widgets & Conditional Statements
wordpress
I followed this tutorial to create custom metaboxes. It seems like qtranslate enables you to use shortcodes almost everywhere. For example: Post titles: <code> &lt;!--:en--&gt;Cheng Feng Enterprises&lt;!--:--&gt;&lt;!--:zh--&gt;鄭峰企業&lt;!--:--&gt;&lt;!--:es--&gt;Cheng Feng Compania&lt;!--:--&gt; </code> Widgets: <code> ...
recently I used qtranslate with metaboxes. In my function.php I added code for display n metaboxes by n languages, in the save data event, I use qtranslate_join, this function make the magic.
Has anyone successfully integrated qtranslate with custom metaboxes?
wordpress
I'm creating some custom templates and I keep running in to a problem where I get'Page not found'. After a bit of debugging, I discovered that I only get this if my URL contains <code> www.mysite.com/custom_page/?name=donkey_boy </code> . If I use <code> www.mysite.com/custom_page/?full_name=donkey_boy </code> , the pa...
I guess this'll solve your query... WordPress Reserved Terms. Just search for 'name', it's there.
Is 'name' a reserved word in URL's?
wordpress
having problems with filtering a posts attachments by tag... It worked fine until i added the tag__in arg (and other variations of it). <code> $vidArgs = array( 'tag__in' =&gt;5, 'post_type' =&gt; 'attachment', 'post_parent' =&gt; $post-&gt;ID, 'post_mime_type'=&gt;'video/quicktime', 'posts_per_page'=&gt;20 ); $videos ...
found n easy way of doing this now! Getting images by 'your case' tag and logged in user. <code> $args = array( 'post_type' =&gt; 'attachment', 'author' =&gt; $current_user-&gt;ID, 'post_status' =&gt; 'inherit', 'tax_query' =&gt; array( array( 'taxonomy' =&gt; 'media_tag', 'terms' =&gt; 'yourcase', 'field' =&gt; 'slug'...
attachments with tags and get_posts
wordpress
Is it a bad idea to set your themename and shortname as variables to be used in the various functions of a theme? Example: <code> $themename = mytheme; $shortname = mth; /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function toolbox_page_menu_args($args) { // some code } add_filter( 'wp_...
You can do it easier and without polluting the global namespace: <code> get_option('template'); </code> gives you the (parent) themes name. If you want the child themes name, use <code> get_current_theme(); </code> . You could also use a constant across your theme files: <code> define( 'YOUR_PREFIX-THEME_NAME', get_cur...
Using $themename Variables
wordpress
Is there a way to show a 404 page if the current logged in user does not have the right clearance to view the page? I am looking for a PHP method, something like <code> if( !current_user_can('administrator') ) { show_404(); exit(); } </code> I have thought about using a redirect, but I would like to keep the url the sa...
I was able to display a 404 error by using the following code in my header. <code> &lt;?php global $wp_query; $wp_query-&gt;set_404(); status_header( 404 ); get_template_part( 404 ); exit(); ?&gt; </code> To break it down: <code> $wp_query-&gt;set_404() </code> : tells the wp_query this is a 404, this changes the title...
Redirect Restricted Page to 404
wordpress
How can I link to another WordPress page but move variables to it as well (preferably not through the address bar)? For instance, I have on one page a list of shops in which a user should be able to click on a shop, which would then open the shop page with the correct data. So the shop's id needs to move from the shops...
you could <code> POST </code> the shop id to the target page. otherwise- cookie, session. or just fetch it on the list page via ajax. edit - a simple post request via a form: in your source page: <code> &lt;form action="b.php" method="post"&gt; &lt;input type="hidden" name="id" value="42" /&gt; &lt;input type="submit" ...
Moving variables from one page to another
wordpress
I looking for a simple Wordpress e-commerce plugin which will just associate a downloadable product to a post (here a custom post type) and handle the payment with Paypal and the download page. There are a lot of different plugin but they always provide a complex catalog, create a lot of useless page and don't provide ...
You may want to consider Cart66 . I bought a single site license a few weeks back as I was looking for something along a similar line to you. It doesn't force a bunch of bespoke templates on you, instead, you have to create each product through a custom post (which is what you are doing anyway). However the big benefit...
Looking for a simple e-commerce plugin
wordpress
When we setup the timezone in wordpress settings page. Does it changes the server time? If I call <code> time(); </code> does it returns unix time according to timezone setup in the settings page? I have checked this page here stackexchange-url ("How to get WordPress Time Zone setting?") So, if i need to show suppose t...
WordPress tries to set PHP environment to UTC timezone. Usually it is more reliable to use time zone-aware WP functions, such as <code> current_time() </code> , rather than vanilla PHP functionality.
Wordpress time queries
wordpress
I need to show my users cumulative posts and members registered count by date. It has to be displayed in an array format like this for posts <code> array(array(2011,08,02), 500) array(array(2011,08,03), 520) array(array(2011,08,04), 540) array(array(2011,08,05), 560) array(array(2011,08,06), 580) </code> the same case ...
Here is a very crude script I've knocked up to get what you are after: <code> &lt;?php require('wp-blog-header.php'); $posts = get_posts('numberposts=-1&amp;order=ASC'); $posts_times = array(); foreach ($posts as $post) { $post_time = strtotime($post-&gt;post_date); $offset = $post_time % (60*60*24); $post_time -= $off...
How to create a cumulative posts and members count
wordpress
I want to move my blog to wordpress.com but I do run my own nameservers and I need to do it. Is it possible to use wordpress.com pointing the IPs of the hostname to it but not switching the nameservers?
Here is what WordPress.com have to say on using your domain with them: http://en.support.wordpress.com/domain-mapping/map-existing-domain/ From there they are clearly saying to use their nameservers. This will because they have a number of IP address and any one of them could be the one hosting your website. Therefore ...
Is it possible to use wordpress.com with a custom domain without switching nameservers?
wordpress
I'd like to make that all my posts in the category A belong also to category B (so after that they would belong both to A and B), is there any plugin or MySQL query that could allow me to do that easily?
You can bulk edit posts in the admin. I have never tried more than 500 or so but you can display 999 per page. To have more than the default 20 click screen options. Click posts--> filter by Category A Click Edit---> select all posts ( clicking top square next to "title")--> Apply Click Category B and Update.
How to make that all posts with a category belong also to another
wordpress
I don't want to have to make use of a destination url, so ideally I would like to be able to add the onclick="_gaq.push(['_trackPageview', '/G1/whatever']);" event to the submit button on the form.
This seems to be a valid answer: Use Contact Form 7 . In the "Additional Settings" box enter the following: <code> on_sent_ok:"_gaq.push(['_trackPageview', '/G1/whatever']);" </code> Where <code> /G1/whatever </code> is the Goal URL you set on your Google Analytics options page.
Is there a WordPress form plugin that can easily be configured for Google Analytics goals?
wordpress
i'm hosting several sites. they all have the same base theme that i need to install. I want to develop this theme and have them updated on all the sites simultaneously. I have the following folder structure <code> /theme/ \ mytheme /domain/ \ foo.com \ foobar.com \ foosite.com </code> Would there be any issue with syml...
That will work fine - just make sure they all have read and write access to that shared folder. The symlink command should be: <code> ln -s </code> StackOverflow question: stackexchange-url ("Can two different WordPress blogs on the same server use a common theme folder?")
Install theme on multiple domains
wordpress
Is it possible to create a local wordpress network install on a mac (10.6) using mamp with subdomains? I have tried following some instructions I came across while googling, but apache seems to get hosed when I create virtual hosts. I came across another set of instructions that said only subdirectories will work on a ...
This tutorial was just published at DevPress by Patrick Carey: http://web.archive.org/web/20111222021406/http://devpress.com/blog/how-to-setup-subdomains-for-a-local-wordpress-network It should help you. It has been written for Windows but you should be able to translate it into "Mac"
Can you create a local wordpress network / multisite install on a mac with subdomains?
wordpress
I'm working on a site which is not attached to a domain name yet, so I access to it through an ugly URL like old_server.something.myprovider.co.uk/.../.../ My provider moved me to a new server so I now have to type : new_server.something.myprovider.co.uk/.../.../ Problem is, when trying to access wp-admin, WordPress pe...
Yes cou can change it by accessing the database of your wordpress. It's located in the <code> wp_options </code> table of your wp' database. You'll have to change two values; the <code> siteurl </code> (line 1) and the <code> home </code> (line 37). You can access it through the admin panel of your host and/or sometime...
Can't login after my site was moved to a new server
wordpress
Example: I'm trying to modify an instantiation of WP_Query by using the <code> posts_orderby </code> filter like so: <code> add_filter('posts_orderby', 'favorites_orderby'); $new_query = new WP_Query($args); remove_filter('posts_orderby', 'favorites_orderby'); </code> the <code> favorites_orderby() </code> function is ...
No, filters get arguments based on the call to the filter. Basically, filters get their inputs from the apply_filters function call. If you want to pass in data via another means, use a global variable or wrap the code and the data you want to use in an instance of a class.
Is it possible to add an argument to a custom function added to a filter hook?
wordpress
I have a tricky situation.... I'd like to check for a cookie. If it doesn't exist then then redirect to an internal wordpress page, and set a cookie. And then carry on browsing the site. But i get stuck in a loop if the url doesn't exist. This is what i have so far...any help would be great. <code> function cookiebased...
why not use the <code> init </code> action hook: <code> function has_my_cookie() { if (!is_admin()){ //Check to see if our cookie is set if not redirect to your desired page and set the cookie if ( !isset($_COOKIE["sevisitor"])) { //setcookie setcookie('sevisitor', 1, time()+1209600, "/", "http://localhost/child/", fal...
Wordpress Redirect based on the prescence of a cookie
wordpress
I have an older theme that I've modified to support threaded comments. I would like the individual admins in my multisite install to be able to choose whether threaded comments are enabled. However, I'd like to restrict the ability to choose the maximum number of levels to super admins. Looking at the capabilities, it ...
There is only one hook for threaded comments depth - <code> thread_comments_depth_max </code> and it sets max value for depth ( default is 10 ), you can use this filter and set max depth fox non-Super Admins number that you want. <code> if ( ! current_user_can( 'manage_network' ) ) { mamaduka_thread_comments_depth_max(...
How can I restrict changing the max nested comment levels option to super admins?
wordpress
Using the following code in order to display custom field value, how can I automatically make it into a hyperlink? <code> &lt;?php $custom_fields = get_post_custom($post_id); //Current post id $my_custom_field = $custom_fields['website']; //key name foreach ( $my_custom_field as $key =&gt; $value ) echo $key . " =&gt; ...
<code> &lt;?php $custom_fields = get_post_custom($post_id); //Current post id $my_custom_field = $custom_fields['website']; //key name foreach ( $my_custom_field as $key =&gt; $value ) echo $key . " =&gt; &lt;a href='" . $value . "'&gt;Click Here&lt;/a&gt;&lt;br /&gt;"; ?&gt; </code>
Display custom field value as a hyperlink
wordpress
I just want to add author gravatar near the name of the author. I know that I have to add something in the single.php file, but what to add? Thanks!
If you're in the Loop: <code> echo get_avatar( get_the_author_meta('ID') ); </code>
I want to display author gravatar on posts. How to do this?
wordpress
I need to be able to get the tax percentage for the cart in wp-ecommerce. I have tried using: $wpsc_cart-> tax_percentage but it does not return a value. Has something changed in the newer versions of wp-ecommerce?
<code> $wpsc_cart-&gt;tax_percentage </code> contains the tax percentage for me using the latest version 3.8.6. make sure you have enabled tax and added a tax rate under settings > store > taxes.
how to get tax percentage in wp-ecommerce
wordpress
I'm using the following code to show the subcategories of a category within my archive.php page: <code> &lt;?php if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category-&gt;cat_ID) != "") { echo "&lt;div id='catlist'&gt;&lt;ul&gt;"; wp_list_categories('orderby=name&amp;hide_em...
<code> wp_list_categories </code> formats the results, instead you want to try <code> get_categories </code> and create your own loop to format the results. I do not know exactly how you want it formated, but this gives you the general idea. <code> &lt;?php if (is_category()) { $this_category = get_category($cat); if (...
Show Subcategory Description
wordpress
My site works with phrases and texts In one category, the users send statements and debate about it. In another category, are sent statements and debate about them. I would like to show only the title of the post into a certain category, since they are not phrases and content needs, just the title. in another category,...
resolved, link : codex.wordpress.org/Category_Templates
display only the title of the post into a certain category
wordpress
I'm trying to make a table of users by role type. What is the best-practices method of getting the user id? My goal is to print each users first &amp; last names, username and email. What I have now: <code> $get_admins = array( 'blog_id' =&gt; $GLOBALS['blog_id'], 'role' =&gt; 'administrator', ); $blogusers = get_users...
Your code doesn't work because you're using <code> $bloguser </code> instead of <code> $user </code> . And there's no point in calling get_userdata() since get_users() already returns user objects: <code> foreach ($blogusers as $user) { echo '&lt;tr&gt;'; echo '&lt;td&gt;'. $user-&gt;first_name .'&lt;/td&gt;'; echo '&l...
Best way to get user id for get_users function?
wordpress
I've been developing a WordPress plugin for a friend who needs something completely out-of-the-box, at least what WordPress is cornerned. Now, I could use the WordPress plugin repository to host this, but I've already hosted this project on Google Code and was wondering if there was any fancy code which would make Word...
Yes, this is possible take a look at WPML to see how its done, also there is an an entire chapter in stackexchange-url ("Professional WordPress Plugin Development") to show you how its done and here is the code that goes with it
Hosting plugin Google Code with auto update?
wordpress
I'm writing a plugin and having a problem. I have <code> add_action('publish_post', 'sender'); </code> and I want this function to run first before the add_filter function, although it won't. Is there a way to do this? I've tried moving the add_filter below add_action but that doesn't work. Also pasting the add_filter ...
It doesn't matter the order in which you call <code> add_action() </code> and <code> add_filter() </code> . What matters is the order in which the corresponding <code> do_action() </code> and <code> apply_filters() </code> are called. So, if <code> apply_filters('wp_insert_post_data') </code> is run before <code> do_ac...
Using add_action before add_filter on a plugin?
wordpress
I frequently need to add several Name-Value pairs to the Custom Fields of a post. At present I add these one by one, by entering the Name and Value and clicking Add Custom Field. I'd like to speed this up by entering several pairs into a single box (textarea, prompt, whatever), and have some JavaScript parse them and a...
Quick search shows that related part of form is generated by <code> meta_form() </code> function. Start from there I guess. Also note that you will need to retrieve from source and submit nonce that protects that form. I am not sure if submitting single field invalidates the nonce there, but that also might be the case...
How can I duplicate "Add Custom Field" with just JavaScript?
wordpress
Is there any equivalent to functions like <code> plugins_url() </code> and <code> content_url() </code> that give you either the relative paths or the file path. For instance, instead of http://localhost:8888/wordpress-3.2/wp-content I want: /Users/username/Sites/wordpress-3.2/wp-content I know that I can build this pa...
There aren't any for plugins, but you can (and should) use WP_CONTENT_DIR, instead of ABSPATH. For themes you have locate_template().
Are there functions for file paths, instead of just urls
wordpress
I'm using Simple Local Avatars for uploading custom user avatars. How can I create a frontend page with the avatar upload function? Below please find the code from Simple Local Avatars plugin: <code> &lt;?php /** * add field to user profiles */ class simple_local_avatars { function simple_local_avatars() { add_filter('...
Sergey, use this in place where you are going to put form to edit avatar: <code> &lt;?php $myAv = new simple_local_avatars(); $myAv-&gt;edit_user_profile($profileuser); ?&gt; </code>
Frontend Simple Local Avatar upload
wordpress
is it possible to sign in with user_email instead of user_login , please ? Thanks.
Here's how we do it: <code> $user = get_user_by('email', $email); if (wp_check_password($password, $user-&gt;user_pass, $user-&gt;ID)) { // Login successfull, redirect if needed wp_set_auth_cookie($user-&gt;ID); } </code> Assuming of course that you got the $email and the $password variables from a POST request or some...
Is it possible to sign in with user_email in Wordpress?
wordpress
I'm using the following code to display a custom value. The custom value being 'website' <code> &lt;?php $custom_fields = get_post_custom($post_id); //Current post id $my_custom_field = $custom_fields['website']; //key name foreach ( $my_custom_field as $key =&gt; $value ) echo $key . " =&gt; &lt;a href='" . $value . "...
How about: <code> $thumb = get_post_meta( $post_id, 'thumb', true ); $url = get_post_meta( $post_id, 'website', true); echo "&lt;a href='$url'&gt;&lt;img src='$thumb' /&gt;&lt;/a&gt;"; </code> The <code> get_post_meta() </code> function is ideal when you know ahead-of-time the names of the fields you want to retrieve. ...
Display two custom values from a post
wordpress
I'm trying to enable the WordPress content editor as a droppable using jQuery UI drag and drop. However, I can't get the drag to drop, or the drop event to fire. Is there something I'm missing? <code> &lt;ul id="keywords"&gt; &lt;li&gt;drag one&lt;/li&gt; &lt;li&gt;drag two&lt;/li&gt; &lt;li&gt;drag three&lt;/li&gt; &l...
In the above example the following line: <code> jQuery(".myDiv").find("li").each(function(){ </code> should be: <code> jQuery(".keywords").find("li").each(function(){ </code> That should enable the list items to be dragged and dropped. To allow the items to be dropped on the TinyMCE textarea the following code works. <...
How to enable the content editor as a droppable target with jQuery-ui?
wordpress
When using wp_mail, is there any way to verify that the email was sent correctly?
As you have probably found, for wp_mail : A true return value does not automatically mean that the user received the email successfully. A possible workaround is to add an email address that you have access to to the recipients list, and if the one email address receives the mail you can be reasonably (although not 100...
Using wp_mail - verify that email was sent?
wordpress
I'm looking for a way to only show posts results that contain all of the custom fields requested. Not one or the other. I was only able to get results with one array at a time. Any help would be appreciated. <code> $documents = array( 'post_type' =&gt; 'documents', 'meta_query' =&gt; array( array( 'key' =&gt; 'document...
<code> meta_query </code> has a <code> relation </code> parameter just like <code> tax_query </code> so: <code> $documents = array( 'post_type' =&gt; 'documents', 'meta_query' =&gt; array( 'relation' =&gt; 'AND', array( 'key' =&gt; 'document-type', 'value' =&gt; 'manual', ), array( 'key' =&gt; 'document-status', 'value...
Query post types with multiple keys
wordpress
I'm working on a custom data table to display in the WordPress dashboard. The table populates from a database table I built in a plugin. I've been using the provided WordPress Custom List Table example for most of my coding questions in this area, but the example doesn't have anything for handling bulk actions. Here is...
Assuming you're using the standard column_cb() function, the list table will pass the IDs of the selected rows in an array in $_GET, labeled as whatever you assigned to 'singular' in the list table's constructor. Here's a typical column_cb(): <code> function column_cb($item){ return sprintf( '&lt;input type="checkbox" ...
How are bulk actions handled in custom list table classes?
wordpress
The following function works perfectly when logged-in visitors go to http://sitename.com , taking them to the site homepage. When logged-in visitors go to http://www.sitename.com , however, they're incorrectly redirected to http://sitename.com/splashpage . Does anyone know what's causing this? I have tried switching my...
Figured it out, though this is the lamest solution ever: I hooked into wp_footer instead of template_redirect. If anyone has a better solution or place to hook in I'd love to hear about it - thanks! EDIT: That wasn't the fix I thought it was. Turned out I was writing the function poorly, and did need to be using templa...
wp_redirect not working when going to www version of site
wordpress
I have a client who's site is built using WordPress. The account is using cPanel with webmail accessible at domain.com/webmail. They have 2 email accounts setup (user1@domain.com and user2@domain.com). I would love to be able have them access their webmail by logging into their WordPress site and clicking a menu link s...
You would have to write this from scratch but it is entirely possible. cPanel webmail is already configured to work with Horde, Roundcube and SquirrelMail which are all open source and very well documented. The main issue that wouldn't make it seamless is that cPanel uses exim4 as an email server and there would be no ...
Sync User to cPanel webmail?
wordpress
This might be a total dummy question, but I have no idea where to enter the forum description with bbpress. I see it on plenty of other bbPress-powered forums, and the plugin is inserting <code> &lt;div class="bbp-forum-description"&gt;&lt;/div&gt; </code> into my table of entries, but when I create or edit a forum, I ...
Are you using the standalone, or the plugin? I'm not sure if there is a difference honestly, I've never touched the standalone. Anyway, I have the plugin going From my admin panel I have the option of adding/editing forums/topics/replies Clicking on Add New for forum brings up a standard WP post screen The title is the...
bbPress plugin - How do I add a forum description?
wordpress