question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I'm creating a child theme off of wp-framework and in it's header it uses <code> &lt;?php echo IMAGES . '/favicon.ico'; ?&gt; </code> to recall the folder where images are kept. How do I define or create the location in order to recall it using echo IMAGES? and if I can save the image folder location as IMAGES (If I re...
Many WordPress frameworks include helper functions and pre-defined folder locations. WP Framework is very well coded but requires some learning and inspecting the code to find the documentation. In the file core.php many constants are defined but I did not see IMAGES but THEME_IMAGE is defined so it is likely that IMAM...
defining a folder location in order to recall it
wordpress
I don't need this whole mess of classes like this... <code> &lt;body class="page page-id-829 page-template page-template-page-template-portfolio-php portfolio"&gt; </code> I'd like something like this... <code> &lt;body class="portfolio"&gt; </code> Is there a filter snippet somewhere that has a list of all the classes...
You can configure the <code> $whitelist </code> array in this function to filter out all other unwanted classes. <code> add_filter( 'body_class', 'wpse15850_body_class', 10, 2 ); function wpse15850_body_class( $wp_classes, $extra_classes ) { // List of the only WP generated classes allowed $whitelist = array( 'portfoli...
Remove classes from body_class
wordpress
I would like to achive the following link structure on my site: /properties/ -> a <code> properties </code> page with <code> properties </code> CPT, page 1. /properties/page/2 -> a <code> properties </code> page with <code> properties </code> CPT, page 2. /properties/property-name -> a single <code> properties </code> ...
Try changing the page's slug to something else and changing your post type registration to this: <code> $args = array( 'labels' =&gt; $labels, 'public' =&gt; true, 'publicly_queryable' =&gt; true, 'has_archive' =&gt; true, 'show_ui' =&gt; true, 'rewrite' =&gt; array('slug' =&gt; 'properties', 'with_front' =&gt; false),...
Custom Post Type pagination when CPT 'rewrite' rule and a page have the same slug
wordpress
What is the definite hook which identifies links.php page (add, edit, delete, etc. Blogroll Links), and only this page? Any help would be appreciated. Thanks, cadeyrn EDIT Sorry, I forgot to mention, I need this hook in the admin area. I have a plugin, that brakes an other one, because both are triggered by the admin_m...
OK, I made an awful, but working solution: the hook is <code> admin_menu </code> , than, in the called function, I added <code> if( strstr($_SERVER['PHP_SELF'],'link.php') </code> in the begining. If there's a better solution, please someone send it.
add_action hook for links.php page
wordpress
hey guys, is it possible to format text in a custom field input box automatically with paragraphs? e.g. like the normal text-widget that has the option to say "auto-add paragraphs" when there is a linebreak. I just want my blogauthors to spare typing at the end of every line in a custom field! is there a way to do so? ...
Why don't you use <code> apply_filters( 'the_content', $var ); </code> when outputting your custom field? You don't really want to save the extra paragraphs, otherwise you'll end up seeing them when editing the custom field. This is not what happens with WordPress. If you're not happy with what <code> the_content </cod...
Auto-add paragraphs to custom field?
wordpress
I have this code and all the vars pull in but the latest news is not showing up and the subscribe link is not dropping anything. any ideas? Everything else works like a charm. <code> &lt;div class="content"&gt; &lt;?php get_sidebar('field'); ?&gt; &lt;?php global $current_user; get_currentuserinfo(); $user_info = get_u...
this could be a dumb answer - but is it because you end the loop and have two loops in one page? If so I'd work around it by putting the news loop into a second file and then call it into the main file.... but again I could be giving u a very basic answer to a quite complex problem
Loops for cat links not looping for wordpress site
wordpress
I've enabled my theme with the ability to display the "Featured Image" for the post. However, I'm trying now to determine (1) How to assign a hyperlink to the image and (2) How to call the_post_thumbnail() so that it wraps the hyperlink around the image. I can't find where this is supported in the current release of WP...
I assume you want this to be output inside of <code> the_content() </code> ? You would probably have to define a shortcode that will output <code> the_post_thumbnail() </code> . You could either define the shortcode to accept a URL as an argument, or else wrap the shortcode with HTML anchor tags. EDIT: Assuming you're ...
How to add a user defined hyperlink to the "Featured Image" and the_post_thumbnail()
wordpress
Pretty simple, I've written a widget and I can't find out for the life of me where to save it?! Using the most recent version of wordpress. Thanks, John.
you can make it a plugin and put it in the plugins folder, or you can make it part of a theme and put it in the theme's functions.php file.
Where do I save widget code for wordpress?
wordpress
I have a frontend form with a bunch of input. My requirements force me to use a custom shortcode to create the form. I have already tested a page with that shortcode. Here's my : <code> &lt;form name="myform" method="post" action="&lt;?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?&gt;" enctype="multipar...
I take <code> die() </code> as solution. Though, I don't prefer this. <code> $redirect_link = get_permalink(35) ; //page that has form $script_redirect = "&lt;div&gt;Your form is submitted. Please wait a moment. If your browser didn't redirect, click &lt;a href='$redirect_link'&gt;here&lt;/a&gt;.&lt;/div&gt; &lt;script...
Custom form, shortcode, and submit handler
wordpress
<code> plugins_url() </code> function accepts plugin slug or file path to build URL for. I have following directory structure: <code> /wp-content/mu-plugins/someplugin/css/file.css /wp-content/mu-plugins/someplugin/includes/file.php </code> I need to build URL to <code> file.css </code> in <code> file.php </code> . I c...
<code> __DIR__ </code> is rather new and not always supported. Use <code> dirname( __FILE__ ) </code> . <code> plugins_url() </code> is using … <code> $folder = dirname(plugin_basename($plugin)); </code> … so yes, it is safe. Just use <code> plugins_url( 'subfolder/file.css', dirname( __FILE__ ) ) </code>
Is it safe to pass directory path to plugins_url()?
wordpress
How significant is the guid field in wp_posts? I'm doing a migration and adding a lot of images to the table (via <code> wp_insert_attachment, wp_generate_attachment_metadata and wp_update_attachment_metadata </code> ), but the guid field isn't filled by default. Should i correct this?
If you want to offer an ATOM feed for your attachments you should pass a GUID to <code> wp_insert_attachment() </code> or add a filter for <code> 'get_the_guid' </code> that handles empty values. In most (all?) other cases I wouldn’t care about it.
GUID field in wp_posts - relevance for attachments?
wordpress
On http://wordpress.barrycarter.info/index.php/page/7/ I disabled comments for "USDCAD options vs CADUSD options arbitrage?", but it still has a "Leave a Comment" link. Clicking the link takes you to http://wordpress.barrycarter.info/index.php/2011/02/25/usdcad-options-vs-cadusd-options-arbitrage-2/#respond where it, o...
In the <code> loop.php </code> template file, you will find this line: <code> &lt;span class="comments-link"&gt;&lt;?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?&gt;&lt;/span&gt; </code> If you don't want "leave a comment" to display...
"Leave a comment" link even when you can't
wordpress
Is there documentation somewhere on how to change the default data that is entered into the WordPress database when setting up a new database? I want to change the default category and add a couple others. Change the default post. Set a different theme, activate a couple plugins all by default. All of this to make it e...
See stackexchange-url ("Initialization Script for “Standard” Aspects of a WordPress Website?") and my plugin WordPress Basic Settings for details. You may also use a custom <code> install.php </code> but that’s somewhat tricky for multi-site setups.
Change the default data installed when setting up WordPress
wordpress
I am using developing a child theme for Woothemes' Canvas. I am trying to use functions.php in the child theme to only use actions on my custom post type. This code doesn't seem to be working: <code> add_action( 'woo_post_inside_after', 'my_geo_mashup' ); function my_geo_mashup() { echo GeoMashup::map(); if ($post-&gt;...
you need a <code> global $post; </code> within that function before trying to access the contents of $post.
Custom post type functions.php if statement on action
wordpress
I'm wondering if it's possible to get status and position of metaboxes added to a dashboard-like page. The main page of my plugin has several metaboxes laying in a two-columns page and a "table of content" box on top (with internal links, like a wikipedia page). However, since you can order/hide/reveal a metabox, the T...
You can hook into the <code> sortstop </code> event of the <code> sortable </code> metaboxes, and read the current state: <code> jQuery( function( $ ) { $( '.meta-box-sortables' ).bind( 'sortstop', function( event, ui ) { var sortData = {}; $('.meta-box-sortables').each( function() { sortData[this.id.split('-')[0]] = $...
Dashboard - get status and position of metaboxes and pass them to ajax method
wordpress
I am turning a restaurants website into a wordpress website to allow for the customer to take over content changes. The restaurant has a menu that has categories like Baskets with different types. For instance under the Basket type there is Fish which has a Title, Description, and Price. So what I want to do is to be a...
You can really do it either way. I would personally make a custom post type of "Menu Item" then use a custom taxonomy for type of food (e.g., 'Baskets', 'Poboys', 'Soups', etc.). I would then have a custom fields for sizes and price so you could enter something like '4pc' and '10pc' and '7.99'. One of things I've learn...
Custom post type or just use custom fields
wordpress
I have a WordPress project that I'm using as a CMS. I also have a database with some products in it that I'd like to display on the site (gallery or portfolio maybe?) I have a custom post type for Products that I want to be editable in the wordpress admin (along with the rest of the content). I know I have to do a cust...
What you really need to do is create Custom Taxonomies for your products instead of second custom post type. You can create taxonomies that are hierarchical like categories, or non-hierachical like tags. Give them names, slugs, etc. This way you won't interfere with the blog categories and tags, and get a more customiz...
Custom Post Type for displaying products in a database table
wordpress
I've been trying to wade my way through learning the ins and outs of taxonomies and how to integrate them into themes and I've run into a pretty basic issue that I can't seem to figure out. I started working on this in a BuddyPress install using More Taxonomies. After not being able to get the custom template to load (...
I found this code; <code> function ftc_flush_rewrites() { global $wp_rewrite; $wp_rewrite-&gt;flush_rules(); } function ftc_add_rewrites() { global $wp_rewrite; $ftc_new_non_wp_rules = array( 'find/(this)' =&gt; '/addit.php?here=$1', ); $wp_rewrite-&gt;non_wp_rules = $ftc_new_non_wp_rules + $wp_rewrite-&gt;non_wp_rules...
Can't get a custom template taxonomy page to display
wordpress
I have recently found myself with some time on my hands and with no problem of my own, I would like to solve someone's problem. I'd like to contribute to the WP community how best would I be able to do this? I would like to contribute in way of code. I can take a suggestion of a modules/features I could pick one, maybe...
The Codex has a page on how to contribute to WordPress . Some other ways to help: Help others with questions. On the WP.org support forums, here, or on other sites, it does not matter. Pick stackexchange-url ("a question that has been open for a while") and try to solve it. I have stackexchange-url ("a tool to quickly ...
Contributing to the community
wordpress
I am being forced to use a SOAP service on a site, and for some of the UI elements it is calling images that I have to put in place. I can't point them to a theme folder, as I have no control over the HTML, and I am reluctant to use javascript. the code points to <code> &lt;img src="images/image.jpg" &gt; </code> , I h...
The plugin is search for an 'images' folder inside the current working directory. For example if you are in <code> /blogs/ </code> , a file looking for <code> images/image.jpg </code> is actually looking for <code> /blogs/images/image.jpg </code> . This can obviously get very messy when re-writing URLs with stuff like ...
where is images/image.jpg?
wordpress
My permalink settings is simply <code> /%postname%/ </code> (yes I read from the codex that this is bad performance practice). The result is: a page url might look like <code> site.com/pagename </code> a blog post looks like <code> site.com/post-title </code> a portfolio (custom post type) post will look like <code> si...
Change your permalink structure to <code> /blog/%postname%/ </code> . EDIT To get your custom post type to leave out the <code> /blog </code> part, in its registration arguments array, set the rewrite argument like this: <code> 'rewrite' =&gt; array( 'slug' =&gt; 'portfolio', 'with_front' =&gt; false ) </code>
How to prepend route with /blog for blog listing page only
wordpress
I'm working on building some custom taxonomies for a custom post type I created. The custom post type is <code> Products </code> . For the custom post type <code> Products </code> I've created a taxonomy of <code> Category </code> . Now Under <code> Category </code> , I'd like to have a taxonomy of <code> Sub_Category ...
Hierarchical refers to the terms relation to each other not the taxonomies relation to another taxonomy. Non hierarchical taxonomies are like tags they don't have parents or children. Hierarchical taxonomies means that the terms can have parents and children. taxonomy = category category terms: blue products ( parent t...
Custom Taxonomy Hierarchy for Custom Post Types (eg Categories and Subcategories)
wordpress
I'm trying to hide some fields on public BuddyPress profiles, it is possible? Thanks in advance.
I dont know, but you can hide via css or javascript the areas; via css: <code> #id_or_.class_of_elemet { display:none; } </code>
BuddyPress - A hook available to hide custom born date on public profile view?
wordpress
Is WP a good HTML editor? A friend of mine wants to create HTML pages, but doesn't know HTML. Can WP become a WYSIWIG HTML editor via the appropriate plugin? He'll be formatting images, wanting to place text in specific locations, etc. Nothing too fancy, but not just text either.
WordPress is a CMS (Content Management System) and not an editor. That being said WordPress does have a simple WYSIWIG style editor built into it for formatting the content that you want to post.
WP as an HTML editor
wordpress
I'm looking for a way to allow post editors to see two different previews of the posts they are writing. On the front, the same post can appear it two different sections of the website (each shows a different amount of custom fields). How can I create two preview links (for ex : "Preview with template 1" and "Preview w...
The easiest way to solve this is to create a special template file for previews, that will show the post twice in the different layouts. The following code will use the <code> single-preview.php </code> template file if it exists: <code> add_filter( 'single_template', 'wpse15770_single_template' ); function wpse15770_s...
Is it possible to have two different previews of a post (ie. two templates for one post)?
wordpress
Can you add the visual editor to the description field for custom taxonomies? It would be nice to have this option available when you edit an entry for a taxonomy be it core or custom.
Just wrote the function. It'll display the tinymce editor in every custom taxonomy description right now. Surely you can edit to show it for only some specific taxonomy. <code> /** * Display advanced TinyMCE editor in taxonomy page */ function wpse_7156_enqueue_category() { global $pagenow, $current_screen; if( $pageno...
Can you add the visual editor to the description field for custom taxonomies?
wordpress
I consistently get spam attempts on various and sundry media attachments on my primary WP blog. By default, media has open comments (for instance, http://literalbarrage.org/blog/archives/2009/03/18/daddywill-date-march-2009/dsc08760/ ), yet there is no native way to disable comments on media files. (e.g. https://skitch...
This ought to do it: <code> function wpse15750_comment_check( $id ){ if( get_post_type( $id ) == 'attachment' ) exit; } add_action( 'pre_comment_on_post', 'wpse15750_comment_check' ); </code> EDIT Ignore the above. That will stop new comments, but to do what you want, this is much better: <code> function wpse15750_comm...
What's the easiest way to close comments on media/attachments?
wordpress
I've been hosting my blog on WordPress.com for a few years now, but am starting to feel a bit constrained by some of the limitations. The most troublesome in priority order are inability to include JavaScript in my posts, the requirement to pay an ongoing fee for customized CSS, and inability to install my own WP plugi...
Have a look at page.ly WP Engine I'm sure there are plenty of others. I'm specifically discounting hosts that provide 1-click installs because even they require some administration.
Hosting alternatives to WordPress.com
wordpress
The following blog of okcupid had this interesting feature that shows a "share this" window only when you reach the end of the post: http://blog.okcupid.com/index.php/what-if-there-were-not-so-many-white-people/ How is it possible to do this? Thanks
They've attached a function to the scroll event of the page, it looks at the scroll position of the document relative to its height to detect when you've reached the bottom, in which case they animate the flyout div. jQuery has some easy methods for this: <code> $(document).height(); </code> , <code> $(document).scroll...
How to make a share-this window drop when reaching end of post?
wordpress
I run small wordpress blog with 3-5 users. People add/edit/remove and read content all the time... What I want is to be able to see some sort of statistics.... which posts/pages are most popular, most updated, commented... which external links are the ones clicked most times... etc.... is there a plugin (not external s...
Piwik is similar to Google Analytics, but you install on your own server. Also- I've seen a private internal intranet site that was tracked on Google Analytics. It was certainly not publicly or search engine accessible, so it is possible to at least use GA on a private site if you're curious to investigate further.
Blog statistics
wordpress
If I sign up for a Wordpress blog that is hosted for free by Wordpress here , who will own the content I post, and how much storage will I have? I know I could ask their customer support, but I don't trust companies (their lawyers specifically).
From the TOS : By submitting Content to Automattic for inclusion on your Website, you grant Automattic a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content solely for the purpose of displaying, distributing and promoting your blog. If you delete Content, Automattic w...
Who owns the content posted on .wordpress.com blogs?
wordpress
The basic of what I need; A public page where the visitor have to fill out a form in order to be able to download a large file (the one and the same file for all downloads/users). The file should only be available trough something like a temporary url for a specific amount of time from when the form was submitted. In o...
a simple way would be to set a cookie with a timestamp when they submit the form, then check for the cookie and valid timestamp when they hit the url to download the file. a more complicated process would be to generate a unique url key for each user, put that in a db table with a timestamp, then look up the url, check...
Time limited file download upon form submit
wordpress
Hi to all I'm running a wordpress based website and I need to let the users choose how to show the posts inside categories pages. I would like to have a button inside a category page that can be clicked so the reader can choose if he wants to see posts ordered by date or from A to Z or from Z to A. Is there anyone who ...
First in your category.php (depending on your theme files) add a simple form to let the user sort A-Z or Z-A: <code> &lt;form action="" name="custom_order" method="POST"&gt; &lt;p&gt; sort order: &lt;select name="CU_Order" id="CU_Order"&gt; &lt;option value="ASC"&gt;A-Z&lt;/option&gt; &lt;option value="DESC"&gt;Z-A&lt;...
How to let users choose posts order in categories?
wordpress
I currently have a taxonomy called wpsc_product_category. Under that taxonomy I have several terms used as sub-categories, and finally each sub-category has a number of products. I'm trying to use wp_list_categories to show an ul starting from the parent category of the current product your are viewing. ¿Is this possib...
this will work: <code> $terms = wp_get_object_terms( $post-&gt;ID, 'wpsc_product_category' ); foreach($terms as $term){ if($term-&gt;parent != 0){ // this category has a parent and its id is $term-&gt;parent } } </code>
Use wp_list_categories to list parent categories from actual term
wordpress
I have been having problems with a custom taxonomy not working with a url. For example mysite.com/testcat/test1 will 404 but mysite.com/make/ford will work. More troubling is that mysite.com/?make=ford&amp;testcat=test1 will bring up my test page (both taxonomies where included). Here is a clipping of the functions.php...
Did you flush your rewrite rules after you created the taxonomy? I tested your code (only changing <code> 'videos' </code> to <code> 'post' </code> ) by adding to my functions PHP (TwentyEleven Theme WordPress 3.2 Trunk) then flushed my rewrite rules and created a post and gave it the testcat of test1 and the URL worke...
Random category URLs not working
wordpress
I am looking for a plugin that will embed my amazon affiliate id in outbound amazon links on my blog. I've tried a couple of top plugins (e.g. sorted by popularity) and most are a huge overkill (e.g. providing image popups, search lists, products lists, price integration, etc...) Can someone recommend a plugin that doe...
I've been using the plugin called WordPress-Amazon-Associate . It was easy to setup and has been working fine. For more information: link to the author's home page link to the official WP plugin page
Simple Amazon Affiliate Plugin
wordpress
I have a taxonomy wp_query and i would like to order the list by title and by meta value (numeric value) Have a meta value Interesting = 1 or 0 in the posts Not so interesting posts would be at the bottom of the query GOAL - OUTPUT LIKE THIS: (is this possible with WP_QUERY and WP3.1) A ( META KEY interesting = 1 ) B (...
You can filter the <code> orderby </code> part of the query to get what you want (trying to pass it via the <code> orderby </code> parameter will not work, it will be filtered out). This simple example adds the <code> meta_value </code> sort order before the standard title sort order. <code> add_filter( 'posts_orderby'...
wp_query orderby title and meta key value (WP3.1)
wordpress
I have a client that needs to give access to her clients certain documents. She wants the ability to give them user name and password, so once they log in, they go directly to their page or post which will list the documents available for download. Plugins don't seem to help here and some are way too complicated. I hav...
Well, in short, I had our in-house programmer build me a 3rd party system which we integrated into Wordpress. WP is awesome, but not quite there yet with these kinds of features built in. To the future!
Suggestions for allowing basic users to view their own posts?
wordpress
I've been suggested by my hosting to move from w3-total-cache to wp-super-cache since the later is supposed to be using less memory then the first. Is there any knowledge about this comparison? Is there a way to test it on my own site? (I am on a managed VPS) Thanks.
If you're using a memory cache like APC or memcached, their respective admin pages will have the total memory you're using (my Wordpress installs are using 80MB with W3 Total Cache). You could then install wp-super-cache and see what it does to your memory usage.
Memory consumption in w3-total-cache vs wp-super-cache?
wordpress
I'm trying to set-up pretty permalinks for my site. WordPress has a warning that my htaccess files is not writable. It provided some code to copy and put in the htaccess file. I'm on a Mac, my local machine running WordPress 3.1.1. I coped the code WP provided and pasted it into a new new TextEdit file that I named 1.h...
Open up terminal. Found in Utilities. Type: <code> cd /path/to/htaccess/file/ mv 1.htaccess .htaccess </code> For future edits of the htaccess file I'd recommend learning to use vi in the terminal. <code> cd /path/to/htaccess/file/ vi .htaccess </code>
How can I make an htaccess file on a Mac?
wordpress
I'm using <code> [wp_login_form()][1] </code> to display login form in a jQuery dialog window. If user enters wrong password, the user is taken to the backend. I don't want that. Is there a way to notify user that he entered wrong password and still remain on the same page? Before <code> wp_login_form() </code> came I ...
<code> wp_login_form() </code> creates a form with an action attribute of <code> site_url/wp-login.php </code> and that means that when you click the submit button the the form is posted to <code> site_url/wp-login.php </code> which ignores redirect_to on errors (like wrong password) so in your case either go back to u...
How can I redirect user after entering wrong password?
wordpress
Here is my comments block: <code> &lt;div id="comments"&gt; &lt;?php if (have_comments()) : ?&gt; &lt;h3&gt;&lt;?php printf(_n('1 comment', '%1$s comments', get_comments_number()), number_format_i18n( get_comments_number() ), '' ); ?&gt;&lt;/h3&gt; &lt;div class="comment_list"&gt; &lt;?php $comments_by_type = &amp;sepa...
By default WordPress does not display an avatar for a pingback or a trackback - do they even contain an e-mail address? You can add these to the <code> get_avatar_comment_types </code> filter if you want to change this.
Default Gravatar not showing for pings
wordpress
what is the action hook, if a user activates his profile? For the profile update, it is: <code> profile_update </code> for example. My goal is, to execute a function, if a user activates his profile. Something like this: <code> add_action( 'user_activate','my_function'); </code>
Well there you go Register Plus Redux is the plugin which is adding your new user verification, and by looking at its code there are no filters or hooks which is said because if you make changes to it they will be lost the next time you update, so i would suggest to contact the plugin developer and ask him to add it. B...
Wordpress Hook for user account activation in normal Wp (not MU)
wordpress
I need some help with a custom menu. I'm using WP 3.1.1. I need to create an unclickable placeholder in the nav menu. So, the children will be clickable, but the "title" in the nav bar is not. For example, let's say I have a Shovel Page, Trowel Page, and a Spade Page and I want them all to be accessible under the Tools...
HERE´S YOUR ANSWER http://wordpress.org/support/topic/unclickable-menu-button CHEERS
Unclickable Menu Item Label in Custom Menu with Clickable Children
wordpress
I am a new user with WordPress, and I would like to use mathematical formulas. I have been reading the mathjax pages for hours, such as this one and quite a few others. This may be a bad question, but can someone please help me? All I want to do is enable Latex, and I am hopelessly lost. My most recent attempts have be...
If you have a blog that is hosted on WordPress.com, you can't install extra plugins or modify the theme files yourself - this is only possible with a self-hosted version. However, WordPress.com has enabled LaTeX support for everyone. Just write <code> $latex your-latex-code$ </code> and it will be rendered as images.
Math notation on WordPress.com?
wordpress
I've tried a bunch of AdSense plugins but I can't seem to make any work. Can someone recommend something that is known to work? My requirements are simple: display an ad under the header.
If your requirements end at "display an ad under the header" then just open up your theme's header.php file and paste your adsense code there directly and avoid using a plugin all together.
A reliable AdSense plugin. Does it exist?
wordpress
I would like to add a custom field that is set by a jquery datepicker ui in the post edit panel. Im new to wordpress, so Im not sure how to go about adding something like this. I haven't had much luck with plugins, so I would like to know how one would go about adding something like this manually. I am familiar with PH...
Since you are new to WordPress I would suggest using Meta Box Script for WordPress which provides an easy way of adding your custom fields to the post edit panel and its main features are: Support various field types, including: text, textarea, checkbox, checkbox list, radio box, select, wysiwyg, file, image, date, tim...
Add a Jquery Datepicker to custom field in post edit
wordpress
I am currently in version 3.1 of WordPress and I have a problem with planning my post. In fact, whenever I plan a post, it is written: "Scheduled missed. Could you help me please. Thank you in advance Francis NIKOU
Due to your server configuration, you may need to use the alternate cron method, which uses redirect rather than http loopback. Try adding the following to your <code> wp-config.php </code> file: <code> // Alternate cron method define( 'ALTERNATE_WP_CRON', true ); </code>
Missed scheduled WordPress
wordpress
I'm trying to add BuddyPress nav menu support to my theme and, unfortunately, BP's template tags still aren't fully up to snuff. (Basically, if you're not making an explicit child theme for the BP Default theme, you've got to reinvent several wheels.) So what I'd like to do is Detect when BP is active (I know how to do...
So basically you are asking how to create a custom menu by code and assign it to a menu location: <code> //give your menu a name $name = 'theme default menu'; //create the menu $menu_id = wp_create_nav_menu($name); //then get the menu object by its name $menu = get_term_by( 'name', $name, 'nav_menu' ); //then add the a...
How can I create an auto-populated menu that is automatically assigned to a location?
wordpress
I'm using Mac OS X's built in Apache + PHP with MySQL. Everything works perfectly, except for my pretty %postname% permalinks — they just won't work. I have obviously enabled mod_rewrite and set the AllowOverride setting to All on my httpd.conf file. In case there's anything I can do (I really don't want to run MAMP), ...
Your /etc/users/{username}.conf should look like this: <code> &lt;Directory "/Users/username/Sites/"&gt; Options Indexes MultiViews FollowSymLinks AllowOverride All AuthConfig Order allow,deny Allow from all &lt;/Directory&gt; </code> You also have to change the name Apache runs under to be able to save the .htaccess r...
How to enable %postname% permalinks on Mac?
wordpress
Looking for a plugin that I can hardcode into my custom post type template that pulls the images from gallery images added into the standard WP gallery. Thoughts?
See the code in my stackexchange-url ("answer to a similar question"). It strips out and reworks the gallery shortcode to use with jQuery Gallerific.
Slideshow/Gallery plugin based on WP Core Gallery
wordpress
I have a client (same for my stackexchange-url ("previous post about the slider")) who believes that the url structure needs to include a "google page id" to be compliant with google news. Therefore, they want the url structure set up like: http://www.sitename.com/blog/article-name-goes-here?p=85532 . I think they want...
Go to the Permalink page (in Settings), and choose custom structure, and use something like this: <code> /%year%/%monthnum%/%day%/%postname%/00%post_id% </code>
WordPress Page Id
wordpress
Hey, I'm stuck trying to add a box with settings for all pages (the ones users create/edit). What I'm attempting to do is add 6, 7 check boxes and an input field for all pages that alters the rendering of it; for example: "Display a contact form at the bottom yes/no?" . How do you do this without, of course, editing an...
In WordPress these boxes are called "meta box" and to add one to your new/edit page screen you can use add_meta_box() function (look at the example at the bottom for the examples), you can also use this class which is nicely documented and does most of the job for you. Or you can use a plugin like Verve Meta Boxes whic...
Add box with custom per-page properties
wordpress
I'm using a custom field query (or trying to) : <code> $args = array( 'post_type' =&gt; 'pf_cookbook', 'meta_query' =&gt; array( 'key' =&gt; 'pf_cookbook_recipes', 'value' =&gt; '5', 'compare' =&gt; 'NOT IN', 'type' =&gt; 'NUMERIC' ) ); </code> However, the meta value to be compared is an array. The idea here is I am q...
<code> meta_query </code> needs to be an array of arrays - have a look at the code sample in the Codex again. So, for your example: <code> $args = array( 'post_type' =&gt; 'pf_cookbook', 'meta_query' =&gt; array( array( 'key' =&gt; 'pf_cookbook_recipes', 'value' =&gt; '5', 'compare' =&gt; 'NOT IN', 'type' =&gt; 'NUMERI...
Custom Field Query - Meta Value is Array
wordpress
I am building a site on WordPress. I can't publish posts: when I attempt to do so, the site just hangs and then I get a time out page. However, I can add new pages without a problem. I have tried: Upgrading the WP build. Switching my theme to Twenty Ten. I still cannot publish posts. Deleting all plugins and the plugin...
Considering all the content generated by WordPress websites, it seems rather far-fetched that this would be a WordPress problem. I'd contact your host.
Cannot publish posts, but can create new pages
wordpress
I'm working on a site that has 150,000 comments with an obvious hit in performance; is there an SQL query that can delete all comments older than say 90 days? They're not spam comments, and they are all approved; they're just too numerous. And: what about bulk changing all posts older than 90 days to untick "Allow comm...
Regarding comments- what about the case where a comment older than 90 days has child replies younger than 90 days? for comment and pingback status, this should do it: <code> UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed' WHERE post_date &lt; DATE_SUB(NOW(), INTERVAL 3 MONTH) AND post_status = 'pu...
SQL query to delete comments older than 90 days?
wordpress
I can't seem to find such an option listed here: http://codex.wordpress.org/XML-RPC_wp#wp.setOptions Does it exist? Thanks.
No, that option does not currently exist through XML-RPC. However, you can always create your own method in a plugin and hook it up to XML-RPC. Update There's an upcoming Google Summer of Code project that will be extending the XML-RPC interface to allow direct manipulation of themes, so I won't give away code to imple...
Is it possible to change a blog's theme through XML-RPC command? (and if so how?)
wordpress
Using 3.1.1 with debug on, I am getting following notice. <code> Notice: Undefined variable: _POST in &lt;filepath&gt; on line 1000 </code> Code at line 1000 is <code> $data = $_POST </code> Why am I getting this notice? How can I remove this particular notice?
First check if it is a non-empty POST request: <code> if ( 'POST' == $_SERVER['REQUEST_METHOD'] and ! empty ( $_POST ) { // don't forget to sanitize these data! $data = $_POST; } else { return FALSE; } </code>
Undefined variable _POST
wordpress
I've added a separate menu page (an object page) with minimum access level required as 'Subscriber'. I'm doing this because I'm registering new users and they'll be 'Subscribers' with an extra capability to edit a section that my plugin creates. So I want them to be able to see this menu as well. I created my menu page...
<code> subscriber </code> is a role, not a capability . Use a capability to manage access, e.g. <code> read </code> . To understand the difference better install Justin Tadlock’s plugin Members . For the subscriber role you get a list of capabilities like this: The administrator role in contrast:
Menu page with minimum capability as 'Subscriber' doesn't allow 'Admin' to access it?
wordpress
There are cases in which a plugin or theme needs to create a php file somewhere that can later include it. For example a captcha plugin, or some kind of a templating system like twig/smarty (In my situation it's simple template engine for a collection of widgets). Where should be this file created? The only place I can...
The appropriate place IMHO would be a custom folder that you create inside the wp-content directory Read this before creating files: http://ottopress.com/2011/tutorial-using-the-wp_filesystem/
Where to store PHP files created by plugin / themes
wordpress
Is it possible to automatically email the daily archive.php page as an html email newsletter? For example, at 4am every weekday WordPress would send an email of the 2011/04/25/ page. Any input is greatly appreciated!
I do not think this is built into WordPress currently. This would probably need to be custom-built. It would be some php code that is attached to a cron job. Set the cron job to run every day, and have your php script email out the page. These resources may help: http://ss64.com/osx/crontab.html (via stackexchange-url ...
Automatically email daily archive
wordpress
Is there a plugin or a "hack" that can help me do this? I have spent hours try to figure this out so I would greatly appreciate nay help. I have WP 3.1 running php5 Thanks! eg.: postitle_image-ID.jpg
Hook into the filter <code> 'sanitize_file_name' </code> . See my plugin Germanix URL for a working example. A plugin doing this is Rename Media .
Automatic image renaming based on title
wordpress
I have re-worded this to make more sense. Ok, I have a plugin that uses a remote service that check for updates, much like default WordPress plugins, in this case it just checks an XML file. I want to show a menu bubble like this when an update is available. It can show just a "1" or text like "alert", it doesn't matte...
I would do this when you call <code> add_options_page() </code> , not later. It's always better to do this with the supported API instead of playing with the internal structures. The plugin updater periodically checks the plugin status and then saves the result in a transient . This means that it only reads this cached...
Add update notification bubble to admin menu item?
wordpress
I just imported my entries from my blog into a freshly installed Wordpress. I created a new user..e.g. "bob" (bob has an ID=2 in the wp_users table). I want the author of the new posts that I've imported to be "bob". So I thought that I change the post_author of a post to 2! However, when I went to view the post in the...
the real author id is stored in... post_author in the posts table. not sure what's going on in your case. I've just created a new user now and changed some post_author ids to this new user directly in the database and it's showing immediately when I refresh the admin interface. maybe some sort of cache situation you've...
Changing user of post by changing 'post_author' field in 'wp_posts' table not taking effect. Where is the real post author info kept?
wordpress
When you visit wordpress.com, they have a list of the most popular posts right on the front page. I was wondering if there was a way to do the same thing on my multisite installation. Is it possible, and if it is, how would I go about doing it (plugin? theme?)?
Possibly related: stackexchange-url ("Aggregate Summaries of Posts of Different Blogs in Multisite Instance").
How to display the most popular posts of all the blogs in a mu setup?
wordpress
Okay guys, here's the scenario. I'm am trying to setup a function that will automatically duplicate a post (when published) over to another post type. So, a regular blog post is published, and when it is published, all of its information is copied over to a custom post type (for WP ECommerce), automatically creating a ...
I don't have a solution, but here's the root of your problem: http://core.trac.wordpress.org/ticket/20541 Apparently a call to switch_to_blog() would not repopulate $wp_taxomies, which these taxonomies rely on.
wp_set_object_terms() Fails to Set Terms
wordpress
I'm using WordPress as a Facebook platform and have a page that shows posts from 2 different categories. Each category has it's own pagination using wp-pagenavi. In order to stay in Facebook I need the pagination links to load using ajax. I've seen this article which gives a nice clue about it, but would love to know i...
Take a look at this tutorial: http://www.wpmods.com/easily-ajax-wordpress-pagination
How To create ajaxed wp-pagenavi?
wordpress
Guys, I need to know how to do the following: When I receive a comment ... This comment must be approved by three moderators. To appear on the site. Anyone know how to do it or some plugin?
you can use <code> comment_unapproved_to_approved </code> action hook to call your function which will use a commentmeta field to count how many times that comment has been approved or by how many users and if it's less then 3 then we updated the comment to not approved : update I'm posting an updated code in the form ...
3 moderators to approve comment
wordpress
Is there any plugin that allows you to use a custom field as the thumbnail to display the most popular post within the last day (24 hours)? I have found several plugins but none seem to have the capabilities that would allow me to add a custom field as the image or even a thumbnail at all.
If you know the $Post-> ID of the "most popular post", why not just use <code> get_the_post_thumbnail() </code> ( Codex ref ): <code> &lt;?php echo get_the_post_thumbnail( $id, $size ); ?&gt; </code>
Popular Post With Thumbnail?
wordpress
Just bump into the issue that I can't execute multiple sql queries using the <code> $wpdb-&gt;query() </code> . Generated queries work fine directly in phpmyadmin so its something will the ezSQL class only. By design perhaps? I found this http://wordpress.org/support/topic/wpdb-gtquery-fails-when-multiple-update-statem...
Using PHP 5.3.5, I was unable to make this syntax work even after setting the 5th parameter of <code> mysql_connect() </code> to 65536 ( <code> CLIENT_MULTI_STATEMENTS </code> ). Looks like it's not possible to concatenate multiple queries into one statement as long as the old-school MySQL API is running the show. I as...
$wpdb-> query() multiple query support
wordpress
I have a custom post type (CPT) called <code> event </code> . I have a meta box for the type with several fields. I would like to validate some fields before publishing an event. For example, if an event's date is not specified I would like to display an informative error message, save the event for future editing, but...
You can stop the post from saving all together with minor JQuery hacks and validate the fields before saving on the client side or server side with ajax: first we add our JavaScript to capture the submit/publish event and use it to submit our own ajax function before the actual submit: <code> add_action('wp_print_scrip...
don't publish custom post type post if a meta data field isn't valid
wordpress
i am new to multisite. It is a simple question. I know WordPress multisite can be setup for subdomains. Is it possible to use domains along with subdomains? I have searched google but have not had really good results. Perhaps I have used the wrong keywords. so i can use a single wordpress installation for: domain.com s...
"example2.com sub1.example2com" Actually for subsites off of mapped sites, you want a multi network plugin. Free - http://wordpress.org/extend/plugins/wp-multi-network/ Paid - http://wpebooks.com/networks/
WordPress Multisite. Can domain be used instead of subdomain?
wordpress
This code: <code> &lt;?php comments_template( '', true ); ?&gt; </code> Outputs: <code> &lt;h3 id="comments-title"&gt; &lt;h2&gt; 12 Responses to My Post. &lt;/h2&gt; &lt;/h3&gt; (comments template) </code> I don't know where this h2 tag comes from. I want to get rid of that. And customize my comments-title (so there w...
Comment markup - both the comments list and the comment reply form, will be in the <code> comments.php </code> template file. The contents of this file are entirely Theme-dependent, so any more-specific help will require the content of <code> comments.php </code> .
Wordpress comments title
wordpress
I am doing a WordPress site for a school. One of the pages would have a list of 20 or so students, which would include their name, photo and small blurb. How is this type of thing handled in Wordpress? I would like the user of the CMS to be able to manage this page effectively - adding/removing students etc. I know Wor...
You could create a custom post type 'student', with post thumbnails for the images. The post title would be their name, post content would be the blurb. If the code scares you, there are plugins to assist. Taxonomies are also available to you, which operate like categories and tags, but can be any set of attributes or ...
How is a student directory best handled in WordPress?
wordpress
I'm using mac os x 10.6 with xampp. <code> http://wp3.1/ </code> is the url to where I have WordPress installed. The physical path is <code> /Users/myUserName/Sites/wp3.1/ </code> I do not install plugins or themes in the "natural" way. I have created a directory named "git" which is located in <code> /Users/myUserName...
Symbolic links are … stackexchange-url ("risky") in WordPress. It is easier to use a separate domain for plugins per wp-config.php: <code> define( 'WP_PLUGIN_DIR', '/local/path/to/plugin/directory' ); define( 'WP_PLUGIN_URL', 'http://plugins.dev'); </code> See stackexchange-url ("Strategy On Building Plugin Using Eclip...
Symbolic Links on dev box with plugins and stylesheets
wordpress
The site is Videos-de-musica.com it is a simple wordpress blog with music videos. Somehow the subdomain stats.videos-de-musica.com filled up with spam, I remember setting the domain for pwiki stats, but then uninstalled it and I don't remember what happened to it. This is an example spam page stats.videos-de-musica.com...
Hi @JavierRey: You probably downloaded a theme or plugin that added a "backdoor." stackexchange-url ("Otto") has a good post on the subject: How to find a backdoor in a hacked WordPress
Something is generating spam pages on my site
wordpress
I'm looking for a plugin that is compatible up to the current version of WordPress (3.1.1 as of writing of this question) and that supports some kind of inline highlighting of programming language syntax. Basically, I want to be able to write a <code> function name </code> or a <code> variable name </code> or a quick <...
If you still want to use SO-type backtick markup for styling your inline code examples, I've created some code that will accomplish it. To make it into your own plug-in, just add the code below to your functions.php. It calls the wordpress filter "the_content" to apply the transformation to the content when it is displ...
Highlight Syntax Inline
wordpress
I am building a custom app in WordPress, so I need some means of logging my events. I searched and found this plugin - http://wordpress.org/extend/plugins/wp-logs/ which looks very convenient to use. It uses database to store logs and can display them in the backend itself. Another option for me is to learn WP filesyst...
I would prefer to use WP-Logs plugin because its code looks pretty well and you will not waste so much time writing something completely from the scratch. I also store data in the database more likely because I think database could be scaled more efficiently when needed. The another reason why I would prefer database i...
Options for logging events in WordPress
wordpress
Why is that? It's a new installation. EDIT: I don't have plugins installed and I tried to restore default theme to Twenty Ten, but it didn't change anything.
Upper right corner in posts editing page > "Screen Options"...there you have to check "Excerpt" ;)
Excerpt textarea missing on post editing page in admin panel
wordpress
I want to add a onsite social bookmarking system to a WordPress installation. is there any thing like this available?
I think SexyBookmarks is the best http://wordpress.org/extend/plugins/sexybookmarks/ . There are some others Bookmark Me Simple Social Bookmarks
Is there a good plugin for social bookmarking on site for WordPress
wordpress
I'm looking for an easy to use step by step guide on how to create a MultiColoumn menu for categories on wordpress. Actually in my blog I have 10/12 "main" categories and a couple of them have something like 50 Sub-categories and I will add more so I need something Automatic to show them in my menu. Actually I have one...
You are overloading the taxonomy category . Learn to use stackexchange-url ("custom taxonomies"). Some of your categories are in fact series , others belong into their own taxonomy too. Replace the hard coded navigation <code> ul </code> with a stackexchange-url ("nav menu") and look into the TwentyTen theme: it has a ...
How to create an automatic MultiColoumn MegaMenu with Categories WordPress
wordpress
I want to put my flair in as a widget in the top of my sidebar in my blog. There was a similar question asked stackexchange-url ("here") but the only answer links to the flair page and suggests copying and pasting the html into the theme. I don't want to edit my theme, I want to be able to add is as a widget. Is this p...
You can add the flair code to a text widget. Then go to your WordPress dashboard Appearance - > Widgets Your flair in the sidebar
How to put Stack Exchange Flair as widget?
wordpress
hey guys, weird problem. My blog theme works fine in ie8, ie9 and all other major browsers... however ie7 doesn't even render it? in ie7 it seems like my blog even has serverside problems? any idea what could cause that? In my programming history i've encountered ie7 styling issues and stuff but never something like th...
You have a javascript error on line 451: ReferenceError: Can't find variable: jQuery. and then Failed to load resource: the server responded with a status of 403 (Forbidden): axx1cxj-b.css. The second one looks like s stylesheet that typekit is trying to load.
my blog crashes ie7?
wordpress
Alright, I have almost finished up a clients project in WordPress, but I have hit a wall. I am not really great with jQuery (and I have yet to find a plugin to achieve what they are looking for). The client wants an automatic slider on the homepage that pulls in featured posts out of their five categories. I have scour...
This is one of those things you probably have to do yourself, even though there are some slider plugins, they are difficult to customize. Using a jquery slider is pretty straightforward, they are usually just controlled with ID's and CLASS's, so you can wrap any WordPress code, for instance a wp_query (for featured pos...
WordPress Featured Post Slider
wordpress
I am working on a Thematic child theme and using the WPAlchemy Meta Box Class to create an 'Artwork Info' meta box that I want to conditionally echo like this at the end of each post: Title Medium Dimensions Additional Info My instance of the class is defined like this in <code> functions.php </code> : <code> $prefix =...
$val will never == '' here, because $val is holding your field name, not the data. also, use get_the_value to have it returned, the_value will just echo the data out. <code> foreach ($values as $val) { if ($artinfo_mb-&gt;get_the_value($val) != ''){ $artinfo_mb-&gt;the_value($val); echo '&lt;br /&gt;'; } } </code>
conditionally echo in meta box data loop
wordpress
Aa you know, as of WP3.0 there are options for custom advanced queries, which is great. As of this, some query parameters of custom fields like meta_key, meta_value were deprecated for the new meta_query parameter ( see here ) I try to have a pretty simple query with the new syntax, query posts by a certain post_type (...
You can define the meta key for orderby parameter using the old method (I tested on WP 3.1.1)... <code> query_posts( array( 'post_type' =&gt; 'services', 'order' =&gt; 'ASC', 'meta_key' =&gt; 'some_key', 'orderby' =&gt; 'meta_value', //or 'meta_value_num' 'meta_query' =&gt; array( array('key' =&gt; 'order_in_archive', ...
Custom query with orderby meta_value of custom field
wordpress
Im trying to find a way to set the members search by name and also by username. Now it seems to search only by name. Thanks in advance.
Somebody on a different site had this to say: I don’t recommend to change the core files of buddypress. The best way to do it is to write a custom code (I don’t know how to guide you). So if you don’t mind changing the core files, here is a quick way. Open /buddypress/bp-core/bp-core-classes.php and change the $sql['wh...
BuddyPress - Search members by name and also by username
wordpress
How to clear floats in WYSIWYG editor? Not everyone know how to add <code> &lt;div style="clear:both&gt;" </code> in HTML mode. Is there any way to add extra button to WYSIWYG or plugin. TineMCE doesn't have that option.
Write a simple shortcode to add a <code> &lt;div style="clear: both;"&gt;&amp;nbsp;&lt;/div&gt; </code> Detailed Explanation: http://brettterpstra.com/adding-a-tinymce-button/
WYSIWYG clear:both
wordpress
Is there any way that i can hard code the custom menu items when first theme installed? I am creating a theme which will automatically make some common pages when installed. So I need to know if I can also add them to Wordpress custom menu so client don't need to add them manually? In other words: how to insert/create ...
The Problem with your code is that its not actually adding the links to the menu and only to the menu's output, hence the use of a filter (add_filter) so you are just filtering the output of the menu in fact even if you don't have a menu your link will be shown with the code you are using. But to create a link and add ...
How to Hard Code Custom menu items
wordpress
I always want new posts to have a category, but sometimes I forget. How can I make Wordpress warn me when I'm about something 'uncategorized'?
Category Reminder plugin
Warn me about 'uncategorized' posts
wordpress
I recently discovered Scribu's Posts 2 Posts plugin, which seems to be exactly what I was looking for in order to connect pages and posts for a big editorial website. But I cannot get it to work, which is frustrating because the principle seems really easy. I followed the wiki basic usage example , in my functions.php ...
try <code> 'connected' =&gt; get_queried_object_id() </code> instead of <code> 'connected_from' =&gt; get_queried_object_id() </code>
[Plugin: Posts 2 Posts] How does it work?
wordpress
I have a site with many users and many of them have the same last name. I want to get the emails of all the users with the same last name (IE: Smith) that has a post related to a particular taxonomy term (IE: Baseball). So far I have this code that works great in getting all the users with the same last name ( thanks t...
Hi @Holidaymaine: Here's the query you are looking for: <code> &lt;?php include( '../wp-load.php' ); $sql =&lt;&lt;&lt;SQL SELECT DISTINCT u.user_email AS user_email, um.meta_value AS user_lastname FROM {$wpdb-&gt;users} AS u LEFT JOIN {$wpdb-&gt;usermeta} AS um ON u.ID = um.user_id LEFT JOIN {$wpdb-&gt;posts} AS p ON ...
Querying Email Addresses for a List of Users with Same Last Name?
wordpress
I'm trying to show the archive list like that <code> &lt;ul&gt; &lt;li&gt;Year&lt;/li&gt; &lt;li&gt;Month&lt;/li&gt; &lt;li&gt;Month&lt;/li&gt; &lt;li&gt;Month&lt;/li&gt; &lt;li&gt;Year&lt;/li&gt; &lt;li&gt;Month&lt;/li&gt; &lt;/ul&gt; </code> and so on, with the relative link only on the month. I tried different solut...
Place this in your functions.php file or create a simple plugin... <code> /** * Display archive links based on year/month and format. * * The date archives will logically display dates with links to the archive post * page. * * The 'limit' argument will only display a limited amount of links, specified * by the 'limit'...
Archive list with only years and months
wordpress
Best way to programatically remove attachments that are missing images? I ask because after using a caching plugin, I have images that have been input in the database as attachments that don't actually exist. These usually take the form of xxxx.1jpg, where xxxx.jpg is a valid. Sometimes this number is a 2 or a 21. I gu...
Try this: <code> $imgs = get_posts("post_type=attachment&amp;numberposts=-1"); foreach($imgs as $img){ $file = get_attached_file($img-&gt;ID); if(!file_exists($file)){ wp_delete_post( $img-&gt;ID, false ); } } </code>
remove missing image attachments
wordpress
I enabled the compression option on WP Super Cache (off by default!) on my blog . After that, Website Optimization started identifying my pages as being compressed (before, it didn't). All seemed well with the world, but then I double checked with Page Speed Firefox plugin , and and sniffed the traffic with Wireshark, ...
I'm getting a <code> Content-Encoding:gzip </code> header when I visit your site... <code> Cache-Control:max-age=300, must-revalidate Connection:Keep-Alive Content-Encoding:gzip Content-Type:text/html; charset=UTF-8 Date:Sat, 23 Apr 2011 15:27:48 GMT Keep-Alive:timeout=15, max=100 Server:Apache Transfer-Encoding:Identi...
Does WP Super Cache really compress my pages?
wordpress
I want to be able to take a url and see if the domain is one of the ones Wordpress supports to add embeds via oEmbed. Is there a built in function that does this in WordPress or would I need to create my own? Example: if I have a url from a video site I want to be able to examine the url and be able to tell if the doma...
<code> wp-includes/class-oembed.php </code> has a public variable <code> $providers </code> . So you can build a small function to get all of them: <code> function list_oembed_providers( $print = TRUE ) { require_once( ABSPATH . WPINC . '/class-oembed.php' ); $oembed = _wp_oembed_get_object(); $print and print '&lt;pre...
Is there a built in function to see if a URLis oEmbed Compatible?
wordpress
I want to remove the admin bar from the top of the page and actually place it into a custom location within my theme. Question: How would I call wp_admin_bar() inside a custom div. I would also need to remove the built in css, so that I can apply my own. *I already have a filter to do this part. Reasons: My theme is be...
You can try to output the admin bar at a different location, but the included Javascript always moves the bar to the <code> body </code> element - probably to make it work when a theme has not closed all HTML elements at the end of the page. So if you want to move it somewhere else, you must do this after the standard ...
Is there an easy way to move the wp_admin_bar to my own location?
wordpress
I'd like to show the post type of a post, you can do that with get_post_type() , but in my case the names are not pretty (for ex : p_project_plans). So instead I thought I'd show the asociated "menu_name" (as declared with register_post_type), which looks much nicer (for ex : Project plans). Is there a way to do that ?
Hi @mike23: This code shows you how to get both singular and plural names (assuming you specified them as such in your <code> register_post_type() </code> ) . Note that the code example is presented as a standalone file you can save as <code> test.php </code> file in the root of your website and load in your browser wi...
How to get custom post type menu_name?
wordpress
Is it possible to create the following: A new page dynamically daily, containing the last three posts Archive this page, so that tomorrow's page is a new page, with the three newest posts Basically I'd like to use WordPress for our news releases, we publish three each day. The day's page should contain all three storie...
You can create date.php (you can copy the content for this from archive.php or index.php ) in your theme folder which will handle all the "day" pages... <code> &lt;?php get_header(); ?&gt; &lt;div id="container"&gt; &lt;div id="content" role="main"&gt; &lt;?php $day = get_query_var('day'); $monthnum = get_query_var('mo...
Automatically create a new page daily with last three posts
wordpress
Post save functions are conflicting with each other when adding them to the save_post action hook. 2 different custom post types with 2 different (one for each post type) custom meta boxes. I'm only including the code for 1 of the meta boxes. The other one is very similar and each one works fine separately but not toge...
After doing some more research I found that: Instead of hooking the <code> add_meta_box </code> function into <code> admin_menu </code> it should be hooked into <code> add_meta_boxes </code> Instead of the foreach loop use the <code> update_post_meta </code> function on the save function Instead of using the <code> wp_...
Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
wordpress