question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I've the following navigation: ( example ) <code> &lt;ul id="mainNav"&gt; &lt;li&gt;&lt;a href="#" class="watishet"&gt;Wat is het&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="hoewerkthet"&gt;Hoe werkt het?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="resultaten"&gt;Resultaten?&lt;/a&gt;&lt;/li&gt; &lt;l...
Use the Wordpress Menu system, which allows you to set custom classes (Make sure you open up "Screen Options" and check the "CSS Classes" check box to see the settings)
Adding custom class names to anchor in wp_list_pages
wordpress
I noticed that when I changed the WP_Query to ask for a certain category, the page served was <code> category.php </code> . So I'm guessing there's a block of code somewhere that decides which template to serve based on keys in the query. Where is it?
The template loader determines which template to load for a given view, there's a filter available to change this though, <code> template_include </code> as seen on the source page linked. Moved from comment to answer.
How is WP_Query parsed to determine which template to request?
wordpress
i'm making a wordpress theme and want to use a single archive.php page in order to present posts under a specific author, a category or tag. Now, i'm doing it like : <code> if (is_author()) { } if (is_category()) { } if (is_tag()) { } </code> I know i can divide this in more templates, but i don't want to repeat myself...
you can use it just like you posted which is safe and would do the job just fine: <code> if (is_author()) { $author = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); } elseif (is_category()) { //this will work in categories tags or custom taxonomy $term_slug = get_quer...
Check if tag, category or author on archive.php
wordpress
I´m trying to create a function that creates a breadcrumb trail of Page slugs outside of The Loop. These breadcrumbs show the path from the homepage to the current (sub)page. For example, on the page "example.com/attractions/parcs/parc-name" this breadcrumb would be shown: Home > Attractions > Parcs > Parc Name I´ve do...
Ok, problem solved. I´ll add the script below. Hope it´s useful for someone. <code> if ( is_page() ) { $post = $wp_query-&gt;get_queried_object(); if ( $post-&gt;post_parent == 0 ){ echo "&lt;li&gt; &amp;raquo; ".ucwords(str_replace("-", " ", $post-&gt;post_name))."&lt;/li&gt;"; } else { $title = the_title('','', FALSE...
Slugs as breadcrumbs for Pages
wordpress
I'd like a lightweight way to figure out what is invoking a certain action in an effort to provide logic for certain scenarios where I can't help to avoid a function invocation (for example, a new comment firing <code> edit_post </code> ). Is there a way to figure out which action/filter invoked a function?
Sure, just use <code> current_filter() </code> .
Is there a way to figure out which action/filter invoked a function?
wordpress
Is it possible to create a month by month archive of pages? I know it can be done with posts but I want to do it with pages. I want it to take the date the page was published so if the page was published in August then it would create a link called "August" which in turn when clicked will show all the pages within Augu...
You could probably hack something together, but you should probably understand that, in WordPress, a basic assumption (and operating principle) is that static Pages are not chronological . IMHO, a better approach would be to store the content as Blog Posts , and then to use Categories (or perhaps, a custom taxonomy ) t...
Create a month by month archive of pages (not posts)
wordpress
In my custom post type what I am trying to do is say I have select drop down option called party_ad. The value of the options are obtained via an RSS feed. <code> echo '&lt;select name="ad_Tags" id="ad_Tags"&gt;'; foreach ($rs['items'] as $item) { echo '&lt;option value="'.$item[title].'" '. selected( $adTags, $item[ti...
you can use wp_insert_term() to create the tag and then wp_set_object_terms() to set it as the custom post tag: <code> //get the tag $tag = $_POST['ad_Tags']; //create the tag $term_id= wp_insert_term( $tag, // the term 'post_tag', // the taxonomy array('description'=&gt; 'term description','slug' =&gt; 'term-slug') );...
saving meta/custom field to tag
wordpress
What's the simplest way to add a second html editor to the post/page admin and show the content in a template? What I need is something like a custom field that supports html, but I don't need the options to name the field. And I don't need a visual editor like tinyMCE; just html will do. What I'm thinking of is simply...
I use Bill Erickson's custom meta boxes or plugin like Secondary HTML Content (probably the easiest solution)
Simplest way to add a second html editor to the post/page admin?
wordpress
I am getting trouble with WordPress comment posting. As per my WP setting there is no approval needed to display the comments under blog after posting. Most of the comments posted display immediately. But some of them do not display and need aproval from the admin / Author.
You need to check all of the following options under <code> Dashboard -&gt; Settings -&gt; Discussion </code> : Before a comment appears Before a comment appears An administrator must always approve the comment Comment author must have a previously approved comment Comment Moderation Hold a comment in the queue if it c...
WordPress Comment posting problem
wordpress
I have created a custom post type in wordpress and have 90% of the functionality working correctly, but I am having a bit of trouble trying to create a custom listing page template. Currently it is using the default index.php page to bring out all the posts and I have tried to override this by creating a page-post-type...
I think you want to create archive page for custom post type, create <code> archive-{post_type}.php </code> and it'll display you custom post type content. Also see codex: http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Types_display
List page for custom post type?
wordpress
I have to add a lot of items in wordpress menu (lot of 2nd level items) is there any bulk menu item creation method available to do it ? is there any way to add wp-ecommerce categories in wordpress custome menu
Goto Appearance -> Menus You can see all categories listed here including wp-ecommerce categories. Just create a new menu for your wp-ecommerce categories. Lets call it "ecomcategories". You can call this menu in your theme using this code. <code> &lt;?php wp_nav_menu( array('menu' =&gt; 'ecomcategories' )); ?&gt; </co...
Bulk Custom Menu and Wp-Ecommerce
wordpress
I'm using custom fields in my wordpress default post area. So i don't want wordpress default description box. I mean i dont want this field. Instead of description box i want excerpt box there. Please help me. Thanks
you can use simple one liner with remove_post_type_support() : <code> remove_post_type_support( 'post', 'editor' ); </code>
How to hide wordpress default description box?
wordpress
How would I get the top-level parent of a given term? I am using <code> wp_get_object_terms </code> to get taxonomy terms on posts, but instead of showing all tagged terms, I only want to show tagged terms' top-level parents. So if these are my selected terms, I only want to show Breakfast, Lunch and Dinner. <code> x B...
Thanks to Ivaylo for this code, which was based on Bainternet's answer. The first function ( <code> get_term_top_most_parent </code> ) accepts a term ID and taxonomy and returns the the term's top-level parent (or the term itself, if it's parentless); the second function ( <code> hey_top_parents </code> ) works in the ...
Get the the top-level parent of a custom taxonomy term
wordpress
stackexchange-url ("Bainternet") assisted me stackexchange-url ("earler") with the relation AND parameter. What I need to do now is determine how to query multiple vales from a single key. If I try to specify two arrays with the same key the query fails. Is there a way to use an array in the value?Something similar to....
Just add <code> 'compare' =&gt; 'IN' </code> : <code> 'key' =&gt; 'document-type', 'value' =&gt; array( 'Install Manual', 'User Manual' ), 'compare' =&gt; 'IN' </code>
Querying multiple values from a single key
wordpress
Is there a way to use wp_enqueue_script() for inline scripts? I'm doing this because my inline script depends on another script and i would like the flexibility of inserting it after it's loaded. Also, It's an inline script because i'm passing php variables into the javascript (like theme path, etc) Thanks in advance.
Well, you have wp_localize_script(), but that's only for passing data. Otherwise, you can do this: <code> function print_my_inline_script() { if ( wp_script_is( 'some-script-handle', 'done' ) ) { ?&gt; &lt;script type="text/javascript"&gt; // js code goes here &lt;/script&gt; &lt;?php } } add_action( 'wp_footer', 'prin...
wp enqueue inline script due to dependancies
wordpress
I don't see any way of testing which template file is being loaded, if the template file is not a page template. Otherwise I would use is_page_template(). For instance, I am using a home.php template file to pull in the content from multiple pages(don't ask), how would I check that home.php is the template file being u...
Just type in some text like "Debug" into the non-Php area of home.php (the part not surrouded by ) and see if it appears. If so, you know that home.php is being used.
Is there a way to check which template file is being loaded, if it is not a page template file?
wordpress
I've designed a grid-based portfolio theme for a photographer; for each portfolio item, I need six different images, all of which have a fixed size. However, no two sizes are alike. Is there a WordPress plugin that will easily allow me to specify a number of different image sizes and choose easily between them when upl...
Have you looked at add_image_size() ? It allows you to create new custom thumbnail sizes for uploaded images. If you need to create new thumbnails for previously uploaded images, use my Regenerate Thumbnails plugin.
Plugin that will let me specify a number of image sizes?
wordpress
Has anyone used Cartpress before that could give me some pointers? I've installed the plugin but struggling to find all the templates it uses to display everything. I'm using the default theme in WP and have set everything up in that. Things I want to include are: Display 3 top products on the homepage. Adjust the look...
So basically, I've never found an ecommerce solution yet that just works. And I've tried a lot of them. They often require the cusom creation of templates, as the shops css and the theme css never seem to play right. Everything always looks pretty crappy for me. Now that being said, the easiest I've dealt with is eshop...
How to adjust the Cartpress e-commerce plugin?
wordpress
whenever admin or any other user logs in a top bar menu ads up. Now I made login for everybody, so I do not want this bar. first I added display:none to admin-bar.css, but the main problem is that wordpress is still adding a white line on the top with: html { margin-top: 28px !important; } how to remove this as this is...
http://vudu.me/88 Has an article about it. But basically <code> /* Disable the Admin Bar. */ add_filter( 'show_admin_bar', '__return_false' ); </code> or also <code> //REMOVE ADMIN BAR remove_action('init', 'wp_admin_bar_init'); </code> I believe in your functions.php will disable it. Probably a better way than just hi...
I want to remove top admin bar from wordpress. How to?
wordpress
I'm working on a site that is using this PHP script to load a random header image every time it reloads. I would like to use Javascript instead to allow the browser to cache images and improve load times and was wondering if there's any benefit to using the PHP script over some JS script for this scenario.
Using PHP sends less code to the end user. (a single img tag instead of all the javascript logic). If you enable browser caching settings correctly (try W3 Total Cache ), once the end user has "seen" all the images, those will all be in their cache, so on the "long tail" JavaScript vs. PHP solution is equivalent.
PHP or JS for header image rotator?
wordpress
I cannot get WPTouch to work with W3 Total Cache. WPTouch admits that there is a known issue with the two, and they send you to a tutorial . The tutorial is out of date, however, and does not work for me. Does anyone have WPTouch working with W3 Total Cache? If so, can you give some directions/instructions?
See: http://wordpress.org/support/topic/wptouch-w3-total-cache-must-disable-browser-caching You'll need to add that long list to Rejected User Agents under Page Cache, Minify and CDN. If your concerned about the browser caching issues when switching between mobile vs. normal themes, you'll need to add some query string...
Getting WPTouch and W3 Total Cache to Work Together
wordpress
When users insert an image into the content, WordPress automatically wraps the image in a hyperlink that, when clicked, creates an "attachment" page showing only the image inside the theme. Can I insert a code in my theme that tells WP not to create this link?
When you insert an image it becomes an attachment, whether you link to that page or not. You can simply select 'none' in the link url field when the image is inserted, it's one of the options in the media panel.
How to force unlink on attached/inserted images?
wordpress
I am using a code to call WP thumbnails and want to add a title="" tag. I would like the title to call the_title... how do I do so? I want to assign the title tribute to the image, not the link. My code: <code> &lt;?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'thmb-archive' ); } ?&gt; </code>
Use the arguments available for <code> the_post_thumbnail( </code> ) function as written in the codex . Edit : just did a test with this and it worked for me: <code> $post_title = the_title( '', '', false);//get the title $attr = array('title' =&gt; $post_title);//set the parameter the_post_thumbnail('full', $attr);//c...
Add title="" to A PHP Code
wordpress
I have several category pages (e.g. example.com/?cat=3) that display only the post titles. I would like to make them display the post as well. What is the easiest way to do this?
Category pages or archives? If you're a little more specific you will probably get multiple ideas, but in general, if you've got a loop you can use one of the two following functions: <code> &lt;?php the_excerpt(); ?&gt; </code> will show the custom or default excerpt for the post <code> &lt;?php the_content('Read More...
Change Category Page Display
wordpress
Can I add a text editor to my plugin menu ? So I can let users edit custom css file? Something like <code> /wp-admin/plugin-editor.php </code> but I want users to be able to edit only one file. The custome css file. Could this be done using Wordpress standard functions ?
This will help you http://keighl.com/2010/01/tinymce-in-wordpress-plugins/
How to add text editor in plugin menu?
wordpress
I have created a simple admin menu that allows users to enter in some basic information that is stored in the footer. When they click save the url appends <code> &amp;settings-updated=true </code> Is there a way, using jQuery to show a success/fail message? Can anyone show me how or give me an example? Thanks in advanc...
See the top answer on this Stackoverflow question. Basically you need to use: <code> decodeURI((RegExp(name + '=' + '(.+?)(&amp;|$)').exec(location.search)||[,null])[1]); </code> stackexchange-url ("Get URL parameter with jQuery")
Admin menu success message
wordpress
It's possible to insert posts by users through the front-end by using plugins such as gravity forms or by using wp_insert_post. However, how would one handle the editing of those posts? This has to be in a safe/foolproof/secure way for users.
WP User Frontend and Post From Site plugins (among others) allow users to create and edit posts from the front-end. I am sure you can find a lot more — try this .
edit posts through front-end
wordpress
I have a custom post form that sends data to a page which uses wp_insert_post to create a post. I can easily sanitize most data, but I have some troubles with my tags, I retrieve in an array: <code> $tags = $_POST['tags']; </code> Before using these tags as tags_input, how can I successfully sanitize all names? Thanks!
If anyone is interested, I solved it like this: <code> $tags = $_POST['tags']; if (count($tags) &gt; 5){ echo 'Niet meer dan 5 tags'; $stop = true; } if (is_array($tags)) { foreach ($tags as &amp;$tag) { $tag = esc_attr($tag); } unset($tag ); } else { $tags = esc_attr($tags); } </code>
wordpress sanitize array?
wordpress
I've just begun setting up the overstand theme to work with my blog, but I've run into a problem. Check out my site: http://beachief.com/ , the problem is pretty obvious. Those two black categories have been like that since I first installed the theme - I have done nothing to change them. I'd like those two areas to st...
You should replace this code: <code> ul.latestoneandhalf { float:left; padding-right:15px; width:225px; } </code> With this: <code> ul.latestoneandhalf { float:left; padding-right:15px; width:100%; } </code>
Overstand theme set up issue
wordpress
I do not allow users to login to my blog, but I would like to enable facebook connect for those who do not want to enter their details in the comments fields all the time. How should I start doing it? Enable on wordpress settings user logins, when implement facebook comment and thats it?
Try the new beta version of my Simple Facebook Connect plugin. http://plugins.svn.wordpress.org/simple-facebook-connect/branches/new-sfc/ I prefer this comment implementation over others as mine does not create WordPress users directly from Facebook connected users when just used for commenting.
I want to enable facebook connect how to do this?
wordpress
Reading through the documentation you have the ability to setup a WP Network in two ways, Sub-Domains and Sub-Directories. The only explanation they give you is Sub-directory sites It works with the use of the mod_rewrite feature on the server having the ability to read the .htaccess file, which will create the link st...
I began using Multisite just a few months ago, and am really loving it. You're going to want to use the sub-domain structure if you have a host that supports it. I use a Media Temple Grid Server plan. It will allow you to create a subdomain and then mask it with a symbolic link. i.e. rtgibbons.mynetwork.com would be ma...
Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network
wordpress
Was wondering if there was a class or programming technique that would allow me to check for the installation and activation of a particular plugin and if said plugin were not installed, to have it downloaded from WordPress's plugin repository? I have a plugin I would like to require scribu's Post 2 Post plugin and I w...
I would encourage against this, but I understand what you're trying to do and do something similar myself. How I do it I build themes that depend on plugins, plugins that depend on plugins, and plugins that depend on plugins that depend on other plugins. If I'm controlling both sides of the development, I do things in ...
How would you require and automatically download dependent plugins?
wordpress
I've inherited a mess of a WP site. I need to be able to take 100+ categories and rearrange parent/child relationships. I need something with a UI that will make this easy. Anyone know of a plugin that does this?
Perhaps stackexchange-url ("Scribu")'s Term Management Tools would be of use to you here, it does various tasks including bulk term management.
Plugin to assign parent category on multiple taxonomy terms
wordpress
This stuff is driving me nuts. The following url does NOT exist and should return a 404: http://www.easyjob.net/resume/ However, if I try to access it, I get a 301 to http://www.easyjob.net/r/cover-letter/resume-and-cover-letter/ Even if I add a redirect to the .htaccess to redirect it somewhere else, I still get the *...
If you remove your Redirect from the .htaccess file, you could try adding a custom 404.php template file to your theme. I'm not sure exactly what you are asking. Do you want the page to Redirect, or do you want a custom 404 page that displays similar items? To achieve the show similar posts using the 404.php template t...
Can Wordpress redirect to a "similar page" in case of 404 error
wordpress
Am looking for carousel slideshow plugin that is similar to the one implemented here . Any JavaScript slideshow that closely resembles that one would do. It does not even have to be a WordPress plugin, any standalone JavaScript library would also be very useful.
there is a plugin (discontinued): http://wordpress.org/extend/plugins/wp-imageflow/ ) and a Nextgen addon: http://wordpress.org/extend/plugins/nextgen-imageflow/ . More samples and the original code (to the best of my knowledge) can be found here: http://finnrudolph.de/ImageFlow/
A carousel slideshow plugin in JavaScript
wordpress
I have been trying and trying to fix jquery issues. i have in my header lots of jquery. I use it for slider and other things that are built into this premade theme. I am unable to add anything that uses jquery because of conflict. i need some help. The board is www.cgwhat.com. The forgot password is jquery and the slid...
At least one issue I can see is that you're including the jQuery framework at least twice. The first line <code> &lt;?php wp_enqueue_script("jquery"); ?&gt; </code> Is the preferred method of including jQuery. Your installation of WordPress happens to include jQuery version 1.4.2. This allows good plugin and theme deve...
Jquery conflict
wordpress
I was encouraged by Dreamhost to go with FCGI, XCache and w3 total cache. But I'm not sure what the optimal settings are, especially re: the Object and Database cache. Any suggestions? Also, I can't get this error message to go away: <code> Recently an error occurred while creating the CSS / JS minify cache </code> Nor...
Recently an error occurred while creating the CSS / JS minify cache... Frederick Townes, the developer of W3 Total Cache, himself said that the notifications "functionality really gives too many false positives right now and should be disabled." That was 4 months ago, and still holds true today. I have this very same e...
Has anyone used the wordpress plugin w3-total-cache on a Dreamhost VPS successfully?
wordpress
I need to display some HTML only if the post being displayed has a category - not a specific category, just any category at all. I tried <code> if (!is_empty(get_the_category($post-&gt;ID))) </code> , but for some reason this isn't working. Has anone else had the same issue?
Use <code> has_category </code> instead. <code> if (has_category('',$post-&gt;ID)) ... </code> If you want to use it in The Loop, you don't need to specify the ID. <code> if (has_category()) ... </code>
Test if post has a category
wordpress
I don't know if I'm in the right place because is not strictly for Wordpress, I think someone can get some benifit of this question without using Wordpress but in this case I'm using it. So, I'm using a modified theme with some plugin enabled, carousel, and other fancy things. There is a problem with some graphics, whe...
This is NOT a good idea. If you get that kind of behavior, then you didn't properly code your carousel thing / CSS. You should hide the element that contains it, and reveal it in the js hook. But if you really want to go your way, here's how: header.php: <code> ... &lt;body &lt;?php body_class('site-loading no-js'); ?&...
How to preload the entire site with javascript?
wordpress
I am developing a site for a client, let's call it <code> whatever.com </code> . He wants to have his Tumblr blog at <code> whatever.com/blog </code> . (Tumblr lets you name the URL at which your Tumblr page will be served, and if it's a site root, you adjust your domain's A-Record, which obviously I can't do here.) Ri...
Hmm, given that it's okay to send the visitor to an entirely different site, but you are trying to get it to show up as a page, I would suggest adding it to a menu. You are probably already aware, but when you are modifying menus (Appearance > Menus) there is a box on the left side called "Custom Links," which just lik...
How should I set up a Tumblr blog at a WordPress Page?
wordpress
I read the answer for stackexchange-url ("this post") which says you can do something like this: <code> http://example.com?post_type=car&amp;color=red </code> When viewing $wp_query everything seems to be working fine. That is, I'm getting 'car' post types that have the 'red' term assigned. However, the request uses th...
Switch the taxonomy.php just like you would the single.php to support specific post custom templates. This is untested code, so it may not work - but, first get the post type $post_type = get_query_var('post_type'); So if $post_type contains post_type = 'car' then include archive-car.php like this: if ( $post_type = 'c...
How can I get this request to use the Custom Post Type page template instead?
wordpress
Does anyone know any wordpress plugin to display the author's profile &amp; image similar to the image attached
here are a few: Author Bio Widget Just Another Author Information Widget User Bio Widget
Wordpress author details plugin/widget
wordpress
I'm getting this error in FireFox: <code> Error: jQuery(domChunk).live is not a function Source File: http://www.bradford.nhs.uk/wp-includes/js/thickbox/thickbox.js?ver=3.1-20110528 Line: 26 </code> This is the function: <code> //add thickbox to href &amp; area elements that have a class of .thickbox function tb_init(d...
I used jQuery(domChunk).bind instead. This seems to work.
Error jQuery(domChunk).live is not a function
wordpress
I keep getting spammed by the same user, well different name and site listed but always the same email, IP, and comment. the email is <code> 1p@ultradrugbuy.com </code> , the IP is <code> 31.184.238.9 </code> , and the message is long and always the same. I want to do 2 things: How can I block this person from commenti...
In <code> Settings &gt; Discussion &gt; Comment Blacklist </code> . You can blacklist comments based on content, name, url, e-mail, or IP. To mark the comments as spam, what I would do, is to do a search for his IP and then there is a checkbox that will select all, then just mark as spam. Trick is, it only applies to t...
How to block a someone from commenting?
wordpress
As the title says, how can i increase the login expiration period? Running a local install it's a little annoying to have to keep logging in, despite the fact i have the browser remember login credentials it's an extra step i have to perform everytime i fire up the local server. I assume if i increase the cookie expira...
Don't know if this is the best way, but I've been using this in functions.php in my themes: <code> function keep_me_logged_in_for_1_year( $expirein ) { return 31556926; // 1 year in seconds } add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' ); </code>
How can i increase the login expiration length?
wordpress
I'm using scribu's Query Multiple Taxonomies to filter posts through multiple taxonomies (which works great!). However, I'd like to allow people to perform further sorting on the results based on custom fields which have numeric values (eg. <code> rate_per__private_session </code> or <code> rate_per_group </code> ) by ...
I think I got it on my own. The code should be: <code> &lt;a href="&lt;?php echo add_query_arg( 'order_by', 'rate_private' ); ?&gt;"&gt;Sort by private&lt;/a&gt; &lt;a href="&lt;?php echo add_query_arg( 'order_by', 'rate_company' ); ?&gt;"&gt;Sort by company&lt;/a&gt; </code> Note: I used another plugin, Custom Query F...
Sort posts after filtering them through multiple taxonomies
wordpress
I currently have a static front page and a /blog. My goal is to have the front page be a grid of hand selected images (similar to a portfolio). I would like to be able to easily switch the images are featured on this page without having to change the raw html. Is the best way to do this, using custom fields on a page? ...
Two categories should do the trick. Featured posts - This category should be applied to posts that you want to show on your home page, with that images grid. You can limit the number of posts (so only the, for example, 6 newest ones would appear) and select the featured image for them on each post's properties. You can...
Featured Images on Front Page
wordpress
I'm interested in installing wordpress and having a static front page and have link to the blog at /blog. How do I install wordpress in the root directory, but have the blog live at /blog I see how I could do it for the blog urls, but do I just change the wordpress url in general settings for this? Thanks.
There's a codex on this issue here: http://codex.wordpress.org/Creating_a_Static_Front_Page I haven't been provided all the details of your site from your post. As in what your original site root is from when you installed it. So i'm making an assumption that this is a new install.
Help with static front page blog at /blog
wordpress
Related to stackexchange-url ("this ticket about issues with inflating data"). So far it had been suggested by API's support to request gzip instead of deflate. However I cannot find a way to override WP settings that set deflate with highest priority as accepted encoding for all requests. Related functions - <code> WP...
Quite an edge case, but the accepted encoding types should be filterable nonetheless. I can see a few situations where fine, granular control over this header would be useful (as in adding an API that uses non-standard encoding). So, while there's no stock hook for this, I have created a Trac ticket for it and submitte...
How to control accept encoding on HTTP API requests?
wordpress
I'm getting confused trying to implement these custom theme hooks. Trying to wrap my head around that. I thought i understood this. but now after reading code for several hours; it's made it worst. How do i modify the argument being passed in the following? <code> functions.php </code> <code> function theme_content() {...
If you want <code> theme_content </code> hook to run with arguments that you pass to <code> theme_content() </code> function you need to write it like this: <code> function theme_content($args) { do_action('theme_content', $args); } </code>
Custom theme hooks / filters - passing arguments
wordpress
<code> Your `warmHome_cutstr` function causes in the inline stylesheet of the gallery to be displayed. See gallery-post.jpg.[http://themes.trac.wordpress.org/attachment/ticket/4560/gallery-post.jpg][1] To solve this, you need to hook into the_content and remove the gallery shortcode. In functions.php: add_filter( 'the_...
To remove the Gallery Short-code completely add this to your themes function.php file: <code> remove_shortcode('gallery', 'gallery_shortcode'); </code>
how to remove the gallery shortcode in wordpress?
wordpress
How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html? I read and it seems its not possible when using permalinks? The objective is to reduce the server load for 404 errors by not loading php.
.htaccess skip WordPress 404 error handling for static files . <code> &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?) RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|...
How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html?
wordpress
Is there any way to get only parent terms from custom taxonomy or category?
Yes, just pass in the parent parameter to <code> get_terms </code> when you call it, as Michael pointed out. <code> $myterms = get_terms( 'taxonomy_name_here', array( 'parent' =&gt; 0 ) ); </code> Will return all terms that have a parent value of <code> 0 </code> , ie. top level terms.
How can I get only parent terms?
wordpress
For efficiency we are trying to hook some JS scripts only a certain page template of a theme that is to hold a form: page-with-form.php On the theme functions.php we've defined a init_method as such: <code> function my_init_method(){ $dir = get_bloginfo('stylesheet_directory')."/js/jquery.js"; wp_deregister_script('jqu...
<code> init </code> is much earlier than page template loading and not appropriate place for enqueues (despite many tutorials and docs using it for that). Hook your function to <code> wp_enqueue_scripts </code> and make sure you are doing that hooking before <code> wp_head() </code> call in template.
Conditional wp_enqueue_script on a page
wordpress
I often need to link to custom taxonomy term archive pages and would love to be able to do so through the AJAX internal link navigator added to the visual editor in 3.1. Is there any way to get this functionality, with either with a plugin or non-colossal changes to the core?
Right now there are no hooks to do that from a plugin and the function that makes the search query itself is not pluggable which means that the only way to achieve that is to hack core files. Currently there is an open Trac Ticket asking for some kind of hook.
Getting archive pages in WP's AJAX internal link finder?
wordpress
Is it possible to include an entire flat-file HTML site (.html, folders/ and CSS) inside WordPress? Essentially, I want to host an HTML site, but have access to WP functions and plugins. Not to interested in a iframe solution as that would break the look of the URLs on the browser address bar. Can I include the html si...
First you need site to be processed as PHP, since WP simply won't work otherwise. I think you can do it for non-.php extensions by tinkering with server config. THen see Integrating WordPress with Your Website in Codex. You can load WP core to required degree and use the functions. However I'd consider just migrating s...
Is it possible to include an HTML flat-file website inside a WordPress theme?
wordpress
Right now, I have this code: <code> function mr_np_activate(){ // hook uninstall if ( function_exists('register_uninstall_hook') ) register_uninstall_hook(__FILE__,'mr_np_uninstall'); } register_activation_hook(__FILE__,'mr_np_activate'); /** * Delete options * **/ function mr_np_uninstall() { delete_option('my_plugins...
You could always use an uninstall.php file for the plugin instead. http://codex.wordpress.org/Function_Reference/register_uninstall_hook If the plugin can not be written without running code within the plugin, then the plugin should create a file named 'uninstall.php' in the base plugin folder. This file will be called...
How can I delete options with register_uninstall_hook?
wordpress
If I upload a given image like my-image.jpg, then following image resizes occurs: http://www.mysite.com/wp-content/uploads/YEAR/MONTH/my-image-100x100.jpg http://www.mysite.com/wp-content/uploads/YEAR/MONTH/my-image-200x150.jpg http://www.mysite.com/wp-content/uploads/YEAR/MONTH/my-image-500x300.jpg also the original i...
create shortened URL function, then add filter on the_content() to replace all img src URL to shortened URL
Complicated image name like flickr does and deny access just to original image
wordpress
Lately I've been reading about MariaDB and Percona Server , two strong alternatives to MySQL that have gained popularity since Oracle bought Sun. As far as I know, both of them could be used with WordPress, but I'd like to know if anyone uses them, and if they really help make our blogs and servers run better than they...
I have personally worked with Percona Server and MySQL, not with MariaDB as of yet. Percona provides support for MariaDB, Drizzle, Amazon RDS, and other MySQL products . I learned at Percona Live NYC that Percona gets the latest version of MySQL and injects 30,000 lines of C/C++ that is unique to its Performance Enhanc...
The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
wordpress
When you want to associate an image to a post which already has its own featured image, you have to use a custom field : you upload an image just as if you wanted to add an image inside your post, but then you just copy the image URL, click cancel, and put the image URL in the custom field value : burdensome. Is it pos...
You can add 2nd featured image using Multiple Post Thumbnails plugin, make sure to follow the installation instruction.
Add an image box besides featured image?
wordpress
I'm working on a new Wordpress theme; the default index view displays the excerpts of recent posts. Some posts will be regarding file downloads, and include an image, description, and link to the location where the described files are hosted. The images for these types of posts will be anchored with links(other types o...
Because I don't have post thumbnails defined, and since posts may or may not contain multiple images, I ended up doing it this way: I turned off tags in excerpts(I had an excerpt plugin enabling tags in excerpt), then I added the following to the function.php file: <code> function catch_that_image() { global $post, $po...
Dynamic Image Links Depending on Excerpt/'Single Post' View
wordpress
I am trying to create two functions, one that catches the first paragraph of some content, and one that catches the rest, but I have hit a bit of a conundrum. I have this in my single.php: <code> &lt;div class='the_content'&gt; &lt;?php the_content(); ?&gt; &lt;/div&gt; </code> which produces: <code> &lt;div class="the...
The paragraphs are done by the <code> wpautop() </code> function, hooked to <code> the_content </code> , <code> the_excerpt() </code> &amp; <code> comment_text </code> as well as <code> 'term_description' </code> for taxonomies. The plugin linked by @javipas does an enormous effort to just add this, but it's a good exa...
Finding the paragraphs in content
wordpress
There's a <code> wp_blogs </code> table which is very usefull when you want to get a list of blogs (and this is what I need to do). The problem is that I can't seem to be able to get the blog language from the <code> lang_id </code> field within that table. It just doesn't match the <code> WPLANG </code> option which s...
I don't know what the lang_id option is for. AFAIK it is not part of the core WordPress options. If you want to check the language of all blogs you could check the blog's own options table for WPLANG, or use the network's WPLANG option (or fail with a locale you need) in a similar way as WordPress' own get_locale() fun...
Getting a blog language (site "lang_id" field vs the WPLANG setting)
wordpress
I would like the Wordpress page link as shown here go to an external URL instead of going to page. What is the best way to set this up? I'm running Wordpress 3.1.3. Thank you.
Goto Appearance -> Menus -> Create a new menu -> Add your link as custom link
How do I make Wordpress "Page" link in the top nav bar go to an external URL?
wordpress
I'm building a WordPress theme framework, that will likely have many options as development progresses. I found a related question: stackexchange-url ("When is it appropriate to create a new table in the WordPress database?"), which indicates that a new table would be more efficient, but I'd like to know more. It makes...
It makes sense that if it's faster to use a new table for a thousand entries, it must also be faster for tens or hundreds of entries. Performance is not about the pure number rows – the real amount of data and their structure counts. Usually, you use just the theme mod API . Your theme data is on a predictable place an...
Efficiency of wp_options vs a new table
wordpress
I have a car database that I want to import into Wordpress as taxonomies. The problem is I can't create 2 taxonomies at once (first is parent, last ones are childs of first). $p = wp_insert_term("Acura", "classified-category", array("description" => "Acura")); $c = wp_insert_term("Acura CL", "classified-category", arra...
The issue is with the taxonomy cache. You have to clear it after you insert the terms in order to see them. I had the same issue, which someone answered for me stackexchange-url ("here"): <code> delete_option("classified-category_children"); </code> Insert that after the term inserts and you should be good.
wp_insert_term - parent & child problem
wordpress
This is a simple question, that's probably been asked before. For internal links between pages, is it better to use a relative link or full permalink? Thank you.
It depends on what you're talking about. If you're talking about using just <code> &lt;a href="/page-title"&gt;Page Title&lt;/a&gt; </code> , then no. It's better to use the full link. However, instead of using <code> http://www.domain.com/page-title </code> , it's better to use <code> &lt;?php echo bloginfo('url'); ?&...
Should I use relative or absolute urls when pointing to internal pages
wordpress
I'm looking for a list of action tags that are relevant when you: create a post, with any method, so basically using wp_insert_post modify a post, like changing status, title, content, terms, meta, anything related to it; remove a post Are <code> save_post </code> and <code> deleted_post </code> enough for this kind of...
Yes, 'save_post' and 'delete_post' cover everything, except modifying meta and terms associated to a post. Those hooks can be found in wp-includes: <code> meta.php </code> and <code> taxonomy.php </code> , respectively.
Actions to use when flushing cache (when posts are added / deleted / modified)
wordpress
I'm on Ubuntu and using LAMP for local dev. I've several WordPress installations for different project and tried to set custom permalinks on all of them, but only default permalink setting ( <code> http://localhost/wpinstalation/?p=123 </code> ) works, other settings are giving 404 error. Any idea how can I fix this? G...
I had the same problem. It sounds like you don't have rewrites turned on in your installation. Find your httpd.conf file, find the following line: <code> #LoadModule rewrite_module modules/mod_rewrite.so </code> And remove the # at the beginning so it looks like this: <code> LoadModule rewrite_module modules/mod_rewrit...
Custom Permalinks don't work on local LAMP installation
wordpress
Been trying to ask on Wordpress forums, but no hits. I'm hoping there are more people here that can help me. My custom contact form page used to work, but for some reason, it results in a 404 error when I submit my form. I am using custom permalinks (/%category%/%postname%/) and that has never been a problem before. I ...
As suggested by Bainternet, prefix all the field names.
custom contact form no longer working (because of 3.2?)
wordpress
I have one shortcode that should be always next to the sidebar: <code> // [shortcode] otuput | default sidebar </code> My theme allows me to set different sidebars for each page. So I have sidebars on a few pages, but not everywhere. What's the best/proper way of achieving this goal? I was thinking about adding <code> ...
I'm still not sure exactly what you're trying to do, but here's one possibility if it's to display something like this: PAGE CONTENT | SHORTCODE/POSTS LOOP | SIDEBAR Do you have control of the shortcode content? If so, you could update it so its output is wrapped in a <code> &lt;div id="shortcodecontent"&gt; --shortcod...
How to attach sidebar to shortcode's output?
wordpress
I'm working on a wordpress site and need to have a widget on the sidebar which has thumbnails, but links to URLs specified per thumbnail rather than the images. It seems simple, but I can't find any plugin to do it in a way a non-developer can from the admin panel. Currently the NextGEN gallery plugin is being used. Is...
You could create your own widget that queries posts from a certain category then displays <code> the_post_thumbnail </code> in an unordered list linking to the post. Example widget (add to functions.php): <code> &lt;?php class c3m_thumbnail_posts extends WP_Widget { function c3m_thumbnail_posts() { $widget_ops = array(...
Widget which displays thumbnails, but links to urls?
wordpress
For a client we'll need 29,000 terms (all the highschool's in the US) and each term needs 6 meta items (address, phone...). My initial thought was to store the term meta information as suggested in this post but after looking through it again I will be using lots of terms and I wonder if it will overload the options ta...
As the article mentions, using wp_options is not a good idea when you have thousands of terms, mainly because there's: a lot of serialization involved OR long option names (the limit is 64 characters) In this particular case, yes, it's appropriate to create some custom tables. To save time, you can use this plugin (upd...
When is it appropriate to create a new table in the WordPress database?
wordpress
get_page() unlike Loop returns the post content without html tags. I need tags. How can I fix this? I don't want to change wysiwyg editor, here is the bad solution http://wordpress.org/support/topic/preserve-html-with-get_pages
I presume you are getting the page content like so: <code> $page_id = 1; $page = get_page($page_id); $content = $page-&gt;post_content; echo $content; </code> If thats the case then you can run the content through the <code> the_content </code> filter: <code> $content = apply_filters('the_content', $content); </code> T...
get_page() unlike Loop returns the post content without html tags. How can I fix this?
wordpress
I have made a custom post type for a child theme. I removed "thumbnail" from the supports array in functions.php and that prevents a featured image meta box from being displayed. However, when in the "add an image" modal dialogue thing, there is still a "Use as featured image" link. Why, oh why? More to the point, does...
Some where in your theme you should have: <code> add_theme_support( 'post-thumbnails' ); </code> Instead of removing support for a post type try only adding support for the post types you want: <code> add_theme_support( 'post-thumbnails', array( 'post', 'movie' ) ); </code>
How to remove "featured image" functionality from a custom post type?
wordpress
My blog have 2 categories: Photos and Texts. I would like do customize the category template so that when it renders Photos post's, I want to show a thumbnail gallery and when it renders Texts post's, I want show only the excerpt. There is an way to do this without hardcoding on category.php? Or, at least, how is the b...
create category templates ; i.e. category-photos.php and category-texts.php; starting with a copy of the code from category.php. you will still need to hard-code the changes in each template.
How to custom category template based on category?
wordpress
I'm trying to create <code> &lt;div class="cat-hidden categories"&gt;&lt;/div&gt; </code> where <code> categories </code> is a list of the categories the current post is posted in. When just using <code> the_taxonomies() </code> , it outputs something like this: <code> &lt;div class="cat-hidden Job Type: &amp;lt;a href...
you can use <code> wp_get_post_terms() </code> to get a list of the post categories and just output the category slug which is already phrased for you, something like this: <code> //in your loop echo '&lt;div class="cat-hidden'; $cats = wp_get_post_terms($post-&gt;ID,'category'); foreach($cats as $cat){ echo ' '.$cat-&...
Use the_taxonomies() to create a simple list
wordpress
I am trying to create a nonce to use with a (public-facing) form. Below is my code: <code> function my_form() { if (isset($_POST['submit'])) { $name = $_POST['name']; $description = $_POST['description']; $output_form = false; if (wp_verify_nonce($_POST['added'], 'add-item') ) { //validate echo 'form submitted with non...
You need to pass the value of the nonce field as first argument to wp_verify_nonce . So, you need to modify the nonce verification part in your code. Also you were using form fields names that conflicts with internal wordpress query vars, you should prefix them with something unique so they do not conflict with wordpre...
Help with forms and nonces
wordpress
I use custom category templates for a few of my categories. Ex: cat-12.php and so on. I use the Fv Simpler Seo and presently it doesnt seem to support an option to edit category templates. Considering that I use custom category templates, is there a function or a way I include custom meta description and custom title (...
for meta description of the category you can use followinf dunction <code> //META DESCRIPTION FUNCTION function seometadescription(){ global $post, $posts; if ( is_single() || is_page() ) : $customDesc = 'meta_desc'; if ( have_posts() ) : while ( have_posts() ) : the_post(); $descriere = get_post_meta($post-&gt;ID, $cu...
How to add meta description, keywords, custom title to a category template
wordpress
Example: video cat id = 4 video cat child category id's = 7,8,9 news cat id = 5 news cat child category id's = 11,12,13 I wanna display choosen categories ( like video and news ) in the different archive.php? Is it possible thanks. ( sorry about my bad Eng ) Thanks for Chris S but its not what i want to do. <code> &lt;...
Create 2 pages category-news.php &amp; category-video.php &amp; put this code in them. Then customize the markup for both as you like <code> &lt;?php $children = get_categories('child_of'=&gt;get_query_var('cat')); $cat = array(get_query_var('cat')); foreach($children as $child) $cat[] = $child-&gt;term_id; $catPosts =...
Creating archive pages for children categories
wordpress
Let me preface this by saying that I hardly ever work with WordPress - in fact, the last time I did a site in WordPress was back during 2.2. Yesterday I made quite a mess of everything and asked several questions here trying to get a basic menu plugin working. I now have the plugin fully functional and behaving exactly...
My point of view is that main purpose and benefit of Settings API is structure . It helps to keep complex settings setups: orderly (logic of registration and sections); secure (nonces, validation callbacks); extensible (hooking into another page or allowing to be hooked into). As with any such structural overhead it be...
What are the advantages to the Settings API?
wordpress
I wasn't sure if this was a PHP issue (suited for StackOverflow) or a WordPress issue (suited for StackExchange), however since my issue appears to be with the <code> add_action() </code> function, I have placed the question here. Here's some simplified code which causes the same issue (to avoid re-posting my couple-hu...
Try: <code> &lt;?php $class = new MyClass(); class MyClass { public function MyClass() { add_action('init', array($this, 'core')); } public static function core() { echo "I never get to here"; } } ?&gt; </code>
add_action with a class method is causing fatal errors
wordpress
I created a custom post type for my blog, to allow easier separation of content. This new post type supports different post formats, but most of them will be galleries. <code> register_post_type('atelier', array( 'label' =&gt; 'L'Atelier', 'public' =&gt; true, 'supports' =&gt; array('title', 'editor', 'post-formats') )...
One option would be to modify the global Default Post Format setting, via <code> Dashboard -&gt; Settings -&gt; Writing </code> . Note that this setting is global , so it would set the default for all post types that support Post Formats. If you have no need of post formats for blog Posts, you could simply enable post-...
How to set a default format for a custom post type?
wordpress
I have 2 kinds of users... Both uses custom form for registeration.... One is parent user and another is child users. Parent user can register and then login and create child users. I have also given interface in theme where parents can manage child users data created by them. Basically site is based on article for chi...
To login as a user you just need the target user ID and these two functions: <code> wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id ); </code> If you do this mid-page, make sure you refresh it to reflect the changes.
To be able to login as different user
wordpress
I'm planning on using WordPress to create an arcive of my starred/shared/favourited items on a few services, such as: Twitter Favourites YouTube Favourites Google Reader Starred Items Stack Overflow Starred Questions etc. As the data for each type is different, eg video/article/short text what would be the best way of ...
Now I would suggest to do it with Post Formats. Before there were Post Formats, I made sth similar to what you're looking to do. Although I am not sure whether it is possible to "grab" You Tube Favorites, others should be possible. I actually integrated a lot of social media feeds using the Feed WordPress plugin and Ya...
WordPress As A Shared Items Collection
wordpress
I recently completed a WordPress site design, and I'm just struggling with one bug: when a user clicks the "Search" button without any content in the text field, they are redirected to a list of posts. Is there a way to modify this action? Ideally, if the text field is empty, the user will be redirected to the homepage...
The default WordPress action is to redirect to the homepage when the search is blank - just what you want! Do you have any plugins or .htaccess settings that may be changing this?
Changing the default WordPress search action
wordpress
Looking at the Codex for wp_insert_post() it states that this function "...sanitizes variables, does some checks, fills in missing variables like date/time, etc. " (EDIT: I updated the Codex entry to include a more robust example that includes security as well as post meta and category assignment) Just wondering whethe...
You don't have to do anything. On WP load: <code> 'init' hook -&gt; kses_init() -&gt; kses_init_filters() </code> Later: <code> wp_insert_post() -&gt; sanitize_post() -&gt; sanitize_post_field() -&gt; 'content_save_pre' -&gt; wp_filter_post_kses() </code> Similarly for post titles, comment text etc. Conclusion: wp_inse...
How safe / sanitized is wp_insert_posts()?
wordpress
A continuation to this question: stackexchange-url ("Replacing WordPress menu functionality with a plugin") Since I really rarely work with WordPress (I've done a lot of work with phpBB, myBB, Concrete5, and custom PHP scripts - but my WordPress experience is limited to one or two simple sites) I feel that I might get ...
First: Use, for <code> options() </code> , the Settings API ( tutorial ). Second: Take a look at the core function and the available filters. Then take a look at the available filters: <code> $sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args ); $items = apply_filters( 'wp_nav_menu_ite...
How do I access the menus produced by Dashboard > Appearance > Menus
wordpress
I've just discovered the WordPress export/import routine under the tools menu. However, upon testing it for the first time, several values stored in my wp_options table did not transfer over. Is there a way to include those values when exporting/importing a site?
Simply read the text, the import/export plugins offer: Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, pages, comments, custom fields, categories, and tags into this site.
WordPress Export/Import for custom options.php values?
wordpress
I'm running a query on a custom plugin to display all categories and put them into a dropdown (the select parts are outside the loop) which looks like this: <code> &lt;?php $ember_categories = get_categories(); foreach($ember_categories as $ember_category) { echo '&lt;option value="' . $ember_category-&gt;cat_ID . '"&g...
Try <code> get_categories( array('hide_empty' =&gt; 0 ) ); </code>
get_categories returns an array with one category
wordpress
I was wondering if there's some constant telling WordPress not to use the minified versions of scripts but instead load .dev ones. Already tried <code> define('SCRIPT_DEBUG', true); </code> but it only turned off script unification.
I use a combination of constants on my local install. <code> define('CONCATENATE_SCRIPTS', false); define('COMPRESS_SCRIPTS', false); // &lt;--- this is likely the one you're after define('COMPRESS_CSS', false); define('SCRIPT_DEBUG', true); </code> I'd imagine the second constant listed above is the one you're after.
Force core to use .dev JavaScript files
wordpress
Google announced Page Speed Service , jumping on bandwagon of all-in-one site optimization and CDN. What are the potential issues, when configuring self-hosted WordPress for it? How will setting up reference domain work with WP? Considering that is required for Google to pull content, but public site URL will be differ...
Potential Issues Google's Page Speed service does not work with "naked domains". That is, it will not work with just "example.com". The domain name must have a subdomain in front of it, such as "www.example.com". This is due to a limitation on Google's implementation of the Page Speed service, which requires you to set...
How will self-hosted WordPress work with Google Page Speed Service?
wordpress
I'm trying to install plugins in my wordpress subsites instead of network activate that plugin. But i'm not seeing any "add new" link in my subsite plugin area. How to install plugins in my individual sites. Am i missing something?. Thanks
Install plugin in networ admin as usual for multisite. Do not activate plugin for whole network. Go to admin of individual site and enable plugin there for that site alone.
How to install plugins in individual sites on a wordpress network?
wordpress
I asked this earlier on StackOverflow.com before realizing there was a StackExchange specifically for WordPress. Here is the link to the old question (for moderator deletion): stackexchange-url ("stackexchange-url I'm creating a WordPress plugin for a custom menu layout. I am well aware that I could just as easily impl...
Err... There's plenty of filters on the menu system. The 'wp_nav_menu' filter is called on the output of the wp_nav_menu() function call. So if you need to modify the menu output, you can use that. The 'wp_nav_menu_items' filter is called on the resulting array of items (basically all the LI items). If you need to modi...
Replacing WordPress menu functionality with a plugin
wordpress
Is there an exact opposite funciton to this one: <code> get_the_title(ID) </code> I know there's: <code> get_the_id() </code> But it doesn't seem to accept any arguments. So, basically, I'm looking for something like: <code> $title = 'Something'; get_the_id($title); </code> I already know this solution: <code> global $...
I'm not sure how to get it via the title, but you can get it via the slug (which is often more useful in my experience) using this: http://erikt.tumblr.com/post/278953342/get-a-wordpress-page-id-with-the-slug Just change "$page" to "$post" if you want to return slugs for posts instead of pages. G'luck!
How to get page's ID if I know the title only?
wordpress
I'm trying to migrate a site to WP. We have a whole bunch of pictures, and I have done some research and figured -- I think -- my best bet is a CSV import of the data, storing the relative URL of the image as a custom field. So, I found stackexchange-url ("this") --which looks ideal -- and I implemented it thus (in fun...
so you're images are already in a custom field? you could use the Get the Image plugin.... i know it will pull your thumbnail from a custom field and i think it might automatically set it as the featured image, tho it has been a while and i'm not sure of that. http://wordpress.org/extend/plugins/get-the-image/
Add url from Custom Field as 'Featured Image'. Code not working
wordpress
I would like to remove the entire "Media" section from the main WordPress admin navigation ont he left hand side. What I don't want to do is just "hide" it with CSS or a plugin/function like I have done so below, because it's still accessible via the URL. This is crucial users shouldn't see each others uploads by any m...
You are indeed correct, before the admin update(i imagine the UI redesign, etc), unsetting items from the menus would in effect prevent access to those pages, that's clearly changed now and requires additional cap checking. This isn't something i've looked into myself(as i've just found out this moment), so i can't spe...
How do I remove the entire Media section from the main WordPress navigation without just hiding it?
wordpress
I have to develop a site in Wordpress similar to an already existing site in JSP which handles approx. <code> 50K users a day and 200 users </code> at a time. And in load testing i get that wordpress can handle only <code> 40 users </code> at a time (with <code> Super Cache </code> plugin <code> ON </code> ). Also I ha...
Reduce the amount of plugins. Check your theme for memory intense stuff or lots of queries. Add this line to your footer or hook it to the <code> shutdown </code> hook to see some basic information: <code> &lt;!-- Time needed to print this page: &lt;?php timer_stop( 0, 3 ); ?&gt; Number of queries needed to process thi...
High traffic management in WP
wordpress
I have a Wordpress Multisite install on our FreeBSD development server. It seems to be stuck at 1MB. I have the following settings in php.ini upload_max_filesize = 100M post_max_size = 100M max_execution_time = 300 All the regular Wordpress installs on the site have a max upload size of 100MB, as expected. Regardless o...
There is a network admin settings page with a Max upload file size field, make sure this is also set correctly.
Multisite stuck at 1MB for max file size
wordpress
I have been attempting to make this theme work, Kelontong by Tokokoo, as seen here : http://stylishwebdesigner.com/6-free-wordpress-ecommerce-themes-to-create-an-online- marketplace-for-your-product/ However, after uploading the theme to my supervisor's wordpress site, and installing and activating the theme, the homep...
Well the theme you mentioned isn't what you get if you click download. The actual theme Kelontong is a Premium Theme. You can find it here: http://tokokoo.com/portfolio/kelontong/ If you are using Kelontong that you found as a free download, it's probably a "Ripped" version. If this is the case, you probably have more ...
Catchable fatal error in appcloud free theme by Tokokoo
wordpress