question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
The code below is near the top of my functions.php and is set to run only when my theme is activated: <code> if ( is_admin() &amp;&amp; isset($_GET['activated'] ) &amp;&amp; $pagenow == 'themes.php' ) { </code> However, even though its creating the category "my-utilities", it is apparently not able to set the parent of...
You're looking for this: <code> register_activation_hook( __FILE__, 'your_plugin_activate_function_name' ); </code> Edit: for a theme, you can use something like this instead: <code> $theme_version = get_option('my_theme_version'); switch ((string) $theme_version) { // an early alpha... run upgrade code case '0.1': // ...
Script only partially runs on theme activation, but runs fully on deactivation?
wordpress
I'm trying to add a custom feed format to my site (basically exporting data to an Excel file) and I'm getting confused by the feed caching settings. I can't figure out how to flush the cached feeds, or to turn off feed caching altogether while I'm in development. I've tried deleting all the <code> _transient_feed... </...
It definitely might be a caching issue. I find REDbot is excellent for quick check of how result is served and what are its caching settings.
How to flush feed? Or set timeout on feed so that it isn't cached?
wordpress
Is there anyway I can set what text should appear in the tags before get_header() is called in my .php files that are inside my theme's directory?
It depends on your theme how exactly <code> &lt;title&gt; </code> is generated. At least some of it should be generated by <code> wp_title() </code> function, output of which you can filter at <code> wp_title </code> hook.
Anyway to specify what should appear in in .php file?
wordpress
Is is possible to override the set # of blog posts to show per page (as defined under Reading Settings in the WordPress admin)? I want to make it so a custom loop that I am using will show an unlimited number.
The argument that controls how many posts are shown in the query is posts_per_page <code> &lt;?php query_posts( array( 'post_type' =&gt; 'post', 'posts_per_page' =&gt; -1 ) ); ?&gt; </code> Also to note is that there is a bug in the 3.0 branch which prevents the -1 integer from displaying all posts. It is fixed in 3.1 ...
Override the default number of posts to show for a single loop?
wordpress
So I have this code that queries a custom plugin generated table in the wp database. It works perfectly as is. But I'm trying to adjust it to use $wpdb instead of the $con function I have set up. Here is the code that works perfectly, but not using $wpdb: <code> &lt;?php $q = strtolower($_GET["q"]); if (!$q) return; $i...
Your error message means that $wpdb in your code is currently pointing to a null pointer. Either WP is not loaded, or you're missing a simple <code> global $wpdb; </code> statement, or both. If you need to load WP, include wp-load.php. Or better, in your JS, use ajaxurl: <code> url = ajaxurl + '?action=youraction' </co...
Have working sql query... trying to adjust it to use $wpdb
wordpress
I have a plugin that creates a custom post type called Squeeze Pages. It has various short codes users can enter to make a squeeze page but I'm not sure how I can go about making the squeeze pages have a custom design, completely different from the homepage. Is this possible? If so, how can it be done?
The code below retrieves the custom post type of the currently displayed content and then decides wheter to print on of your stylesheets. Everything happens depending on your page name. You could also <code> var_dump($ctp_obj_name); </code> or <code> printr($ctp_obj_name); </code> and look what else the custom post typ...
Custom Post Type to override theme's CSS & HTML from Plugins Dir?
wordpress
In my website , I allow to the new user to write posts. but the problem is when the user write post. the state of post is publish. it is appear in front page. I want to read it before the publish , I mean I want to approve it if it is useful or refuse it if it unuseful. I wish you understand me. Thank you very much ,
What role are you assigning to those users? According to Roles and Capabilities documentation in Codex it should be <code> Contributor </code> for users that are allowed to write posts, but not publish them.
How do I manage my users post before publish?
wordpress
There is lots of information out there on how to customize meta boxes added with add_meta_box(), such as enabling WYSIWYG editors on textareas and uploading images. What I have yet to find is a way to reuse WordPress 3.1 Internal Linking feature. Many of my custom fields contain urls to other pages on the site. The new...
WordPress 3.1 Internal Linking feature was coded as a TinyMCE editor plugin so its not really a widget or a meta box but you can code your own meta box and reuse the functiona needed for that. The files you need to look at are /wp-includes/js/tinymce/wp-mce-link.php /wp-includes/js/tinymce/plugins/wplink/js/wplink.js a...
Use WP 3.1 Internal Linking 'widget' as a meta_box
wordpress
I know I can get a categories ID by calling get_cat_ID('category-slug'), however, what is the method to call to determine if a category exists by ID when you don't know the slug? In other words, I need to determine if category id 1 exists. What's the function for this? Can I just use if(get_category(1)) {//do something...
There is <code> category_exists() </code> function, but it seems to be for internal use in admin so you can try <code> term_exists() </code> instead.
How do I determine if a category exists by ID?
wordpress
I am managing a WP 3.0.4 site where every post has the profile of the author appended. Where is the setting to disable this?
There's no exact "setting" in the backend/Admin UI. You'll have to edit your template files (the php files that are in your theme folder). Search for something like <code> &lt;a href=""&gt;&lt;/a&gt; </code> where you got one (or more) of the php (wp native) function or variable: <code> the_author_posts_link(); </code>...
Disable author profile in post
wordpress
I want to change the default "Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts." help text below the Excerpt input area to something more meaningful for my Custom Post Type. I've done something similar with Post Title, using a "translation" fi...
This description is generated by <code> post_excerpt_meta_box() </code> function and is not passed through any explicit filters. It is however echoed by translation-related <code> _e() </code> function and so passes through <code> gettext </code> filter (which from your question you are already familiar with). As for l...
How do I filter the excerpt metabox description in admin?
wordpress
I am looking for a way where, the users of my website will subscribe to a post, and when my post will be edited or updated they will be emailed by my posts contents, My post contains, article, Twitter Updates, a Video How will the users get notification when my posts get updated and also when someone comments on posts
Try this two plugins: Post Notification Subscribe2
Subscribe to email
wordpress
I need some help. I want the same as on this site: http://www.123ipad.nl/ (this is my website) When you go to the home url you come to a page in stead of the newspage. The newspages are in the submap /ipad So i have two questions: 1: how do i get the newspages in the submap /ipad 2: How do i set my first created page p...
please make yourself comfortable with the settings WordPress has to offer regarding your Homepage or Startpage as some call it. Those are not configured via that permalink setting of a specific page (as your image shows) but with options on the Settings Reading SubPanel (Wordpress Codex) . Probably Creating a Static Fr...
How to set a page as homepage in stead of the newspages?
wordpress
I'm using the following code to create drop-down menu and filter button for two custom taxonomies assigned to a custom post type called Page Content (full previous code stackexchange-url ("here")): <code> function parse_query($query) { global $pagenow; $qv = &amp;$query-&gt;query_vars; if ($pagenow=='edit.php' &amp;&am...
You're missing a closing brace on the final if condition. ;)
Creating a drop-down and filter button for two custom taxonomies assigned to a custom post type
wordpress
i have a custom post type called 'auctions', and i'd like to be able to visually differentiate auctions from posts and pages in the backend by assigning a different background color to the auction post type. this could be easily achieved if i had a way to assign a body class to admin pages pertaining to this specific p...
Easy and your css to overwrite the default style like this <code> add_action('admin_print_styles', 'auctions_admin_print_styles_332'); function auctions_admin_print_styles_332(){ if ((isset($_GET['post_type']) &amp;&amp; $_GET['post_type'] == 'auctions') || (isset($post_type) &amp;&amp; $post_type == 'auctions')){ //in...
changing body background color for custom post type in admin backend
wordpress
I'm trying to get an image from Google but... wp_remote_get returns me: <code> Could not open handle for fopen() to https://ajax.googleapis.com/ajax/services/search/images? v=1.0&amp;q=whatever.whatever&amp;key=MYKEYWHICHIDONTPOST&amp;userip=127.0.0" </code> I don't know why: when I enter the url directly I do get resu...
Yep, I experienced that under some network configurations <code> https </code> links fail (my case was behind proxy server). You can use Core Control plugin to test available HTTP transports and disable glitchy one. In my case bumping transport to curl solved issue.
Why Do I get "wp_remote-get: could not handle for fopen()"?
wordpress
I have a custom post type that uses a custom taxonomy. I'm imposing a limit of a single term to each post (using a custom meta box drop down on the edit post screen for the CPT). The term for the taxonomy is assigned using the standard wp_set_object_terms() function. How can I make the taxonomy column sortable (using W...
See the follow-up post: http://scribu.net/wordpress/sortable-taxonomy-columns.html
Sortable admin columns, when data isn't coming from post_meta
wordpress
I have a page that I access at /category/tasks and the file is located at wp-content/themes/my-theme/tasks.php. I would like to make it so I can add a flag after tasks and pick up the query strong in tasks.php. This works fine when I access the page with /category/tasks/?when=upcoming. Can someone tell me how to use re...
Try this: <code> function when_rewrite_rules( $wp_rewrite ) { $new_rules = array(); $new_rules['category/tasks/(\d*)$'] = 'index.php?when=$matches[1]'; $wp_rewrite-&gt;rules = $new_rules + $wp_rewrite-&gt;rules; } add_filter('generate_rewrite_rules','when_rewrite_rules'); </code>
Need help with rewrite_rules_array
wordpress
I just created a custom post type "publication" with the slug "publications". Now im stuck trying to view all the publications index in a URL like: http://www.myExampleSite.com/publications Do I have to create some custom layouts for it, and how it will be using an index clone of twentyten theme, maybe using get_templa...
In WordPress 3.1 virtual directory is created for you custom post type and so you don't really need to do anything but if you are on a earlier version then you will need to make a few step: which you have done most but you will need to change loop-publication.php and add your custom post type to the query args or repla...
Custom post type index (maybe using get_template_part)
wordpress
I know by watching the akismet plugin source how to show a custom message on the plugins page, but I want my message to appear only once after my plugin is activated. How could i do this?
The easiest way would be to check for an stub get_option something like <code> $run_once = get_option('run_once'); if (!$run_once){ //show your custom message here // then update the option so this message won't show again update_option('run_once',true); } </code> hope this helps
How to show custom message once on plugin activation?
wordpress
I use the following custom loop to display a custom post type with the custom taxonomy: <code> &lt;?php // Create and run custom loop $custom_posts = new WP_Query(); $custom_posts-&gt;query('post_type=page_content&amp;page_sections=Apps'); while ($custom_posts-&gt;have_posts()) : $custom_posts-&gt;the_post(); ?&gt; &lt...
In versions less the 3.1 you can't query more then one taxonomy using wp_query, query_posts or get_posts. However you can create your own sql query which you can see an examstackexchange-url ("enter link description here")ple here or use scribu's plugin http://scribu.net/wordpress/query-multiple-taxonomies/ To make it ...
Listing only custom post types with two required categories?
wordpress
I'm using the following code to display posts on my category page but would like to carry the same format through on to the second page of the category as at the moment it moves to the second page but doesn't show the older posts. <code> &lt;?php query_posts('showposts=3&amp;cat=1461'); while (have_posts()) : the_post(...
First make sure you've set your posts per page to 6 in the Reading settings - as I can see you're displaying 2 columns of 3 posts. Then you need to add the page variable to the query_posts attributes, by adding this before you query posts: <code> $paged = (get_query_var('page')) ? get_query_var('page') : 1; </code> and...
Showing different posts on category pages
wordpress
The following code provided by stackexchange-url ("Mike Schinkel"), creates a custom post type and a custom taxonomy. It makes the taxonomy to show up in the custom post type's column. Finally, it inserts some default terms. I would like to insert a second taxonomy for the custom post type (Page Content) called: Locati...
I use the following in my filter hook <code> manage_edit-&lt;post-type&gt;_columns </code> <code> add_filter( 'manage_edit-visitor_columns', array( &amp;$this, '_wp_filter_visitor_columns' ) ); public function _wp_filter_visitor_columns( $columns ) { $columns = array( 'cb' =&gt; '&lt;input type="checkbox" /&gt;', 'titl...
Adding a second custom taxonomy to a custom post type (both shown in its table)?
wordpress
I've seen some examples that use $_post instead of $post. What's the difference and when would you use $_post instead of $post? Example: <code> if (have_posts()) : while (have_posts()) : the_post(); if(!in_category("some-category", $_post )) { do_something(); } </code>
I'm not certain, but if you're talking about $_post as seen here: http://codex.wordpress.org/Function_Reference/in_category It's referring to a post ID so they've probably added the underscore to avoid confusion. The $post variable is a post object with all the details of the post. However, $_POST is a global PHP varia...
When would you use $_post instead of $post?
wordpress
Easy question. Where does the self-hosted WordPress store version information?
If you need to get the wordpress version in your script, there is a global variable: <code> $wp_version </code> (right now it's something like <code> '3.1-RC3-17376' </code> ) It contains the wordpress version. If you need to acquire if from a file, you can read it from <code> /wp-includes/version.php </code> : <code> ...
Where does WordPress store version number?
wordpress
I have a site where i'm using the All-In-One Cufon (Wordpress Plugin) , but having some issues getting it to render properly in IE. The website: [removed] The Problem: It works fine so far in Firefox and the other browsers like Chrome. Even in internet explorer the first time the site loads it works fine but when i ref...
The issue seems to have been resolved in the latest Release Candidate of IE9.
wordpress site | All-in-one-cufon IE Issue
wordpress
I own a network of 100+ Wordpress based websites. All website are separate installations of Wordpress and are on different servers. I would like to create one contact form have it shown in the sidebar all of my Wordpress websites and capture the responses in one database (instead of getting 100's of emails). Ideally th...
the easiest way i can think of is to use a plugin that creates a form by shortcode like contact form 7 for example and I'll break it in to easy steps. Create the form on your main site or what ever site you would like to manage the forms data through. Create a page template with no header or footer just a plain loop an...
How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
wordpress
I need to pass a localized multidimensional javascript object to a page. The object is constructed using php and represents some wp-theme settings. I cant find a way to utilize wp_localize_script for this, as it will not parse multidimensional arrays. Instead I've come up with the solution to use a html5 data-* attribu...
Q: 1.) Is this browser compatible? Yes, for all browsers supporting jQuery data() . jQuery is generally supported by most modern browsers. Q: 2) Are there any security concern to be aware of as compared to using wp_localize_script? <code> wp_localize_script() </code> is mainly doing the same but it's keeping the data o...
security concerns if using html data-* attribute for l10n?
wordpress
WP_DEBUG is telling me: Notice: Undefined index: no_cat_base in myplugin.php on line 20 Here's the lines of code where I'm pulling the value of "no_cat_base" from my options array called "myoptions"... <code> $myoptions = get_option('my_settings'); if($myoptions['no_cat_base']){//This is line 20} </code> Is the correct...
just to be on the safe side use: <code> if (array_key_exists('no_cat_base', $myoptions) &amp;&amp; isset($myoptions['no_cat_base'])){ //do your thing } </code>
Undefined index error on options array element?
wordpress
I've got a working piece of javascript that contains an object literal. But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, and output the correct format. The non-localized (non dynamic) version looks like this: <code> var layoyt_config = { 'hea...
Indeed, <code> wp_localize_script() </code> is simple , it just adds quotes around the values and escapes the content, expecting all of them to be strings. However, there is the <code> l10n_print_after </code> key of the array, which will be printed without any interference at all. It can be used to execute arbitrary c...
pass object/JSON to wp_localize_script
wordpress
I am calling recent comments into my template with <code> $comment-&gt;post_title </code> the variable length is specified like this : <code> SUBSTRING(comment_content,1,180) </code> how could I write a conditional statement just for comments that exceed the limits of the vairable > 180 ? I was thinking It would be goo...
By using a function to perform that: <code> recent_comment_text_more($comment_content) </code> that function would look like (in case you're using PHP, part of your code looks from another language): <code> function recent_comment_text_more($comment_content, $more_href) { if (strlen($comment_content) &gt; 180) { $comme...
Return count for characters in the comment and perform action based on the length
wordpress
An item in SideBarOther shows up on the main article listing page, but when I select an article (same page layout, the article replaces the listing), the item isn't there. There are two items in SideBarOther, and only the 2nd one has this problem (see code below). If I remove the first one, it is correctly gone from fr...
There was a conflict with the Facebook Share plugin. If you add the <code> &lt;script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt; </code> code somewhere before the Facebook Share code, the like button then works, and the share button still works.
Button in SideBarOther widget not showing up on all pages
wordpress
I've placed the string below into my custom permalinks input but it does not appear to have any effect... /%category%/%postname%/ I'm trying to insure that my post links are in the form of /category-name/post-name
Without a link to the site in question, it's hard to understand the exact problem. However, if the issue is the actual word "category" is being includes (i.e. example.com/category/category-name/post-name) then I would use this plugin (it's one I use on almost every site) http://wordpress.org/extend/plugins/wp-no-catego...
How to change permalinks to show categoryname/post-name?
wordpress
I develop a plugin that has a not too small number of settings. So far, there has been a fixed number of them, so I store them in a Wordpress option. Now I consider letting users define (an arbitrary number of) styles, that is sets of options. Since these will still be rather general options, none of the categories lis...
The hierarchy of storing data roughly goes like this (from less functional/complex to more): Transients API Options API Settings API Database Tables Custom file cache Since from your description Options are too limited and database too complex, I would look at Settings.
How to store a medium amount of options?
wordpress
While moving a client's WP site to a new host (single site, not multi), I found that Dashboard> > Users lists two admin accounts (above the detailed shows All(2) Administrator (2) ) but only shows one in the detailed list below; and only one admin account shows in the wp_users table with the ID of 1. Where is this extr...
That's typically the result of users deleting accounts directly in the database. The functions that count users queries to the usermeta table to determine how many users are of a given type, when users do manual deletion they often forget to remove relational data left in the meta table, which in turn throws off the co...
Two admins in Users and one in the database?
wordpress
I'm trying to modify the display of the <code> edit-comments.php </code> admin page and I'm not seeing any filters in it comparable to <code> manage_posts_columns </code> etc. Is there an easy way to do this? I'm thinking the only real way to go about doing this is to extend WP_Comments_List_Table with my own class, ov...
I'm afraid that there is no easy way to get that done yet because the only hook i found is manage_comments_custom_column and that is an action hook and not a filter hook so you can't add columns like manage_posts_columns. so as far as i can tell the long way here is the only way. but you can almost duplicate the defaul...
Are there any filters to add additional columns to the list table on edit-comments.php?
wordpress
I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php template-movieslanding.php template-movieswholesale.php Functionality: A link group is displayed on each of the three template...
you can do it like this: <code> //add movies_view to query vars add_filter('query_vars', 'my_query_vars'); function my_query_vars($vars) { // add movies_view to the valid list of variables $new_vars = array('movies_view'); $vars = $new_vars + $vars; return $vars; } </code> then add a template redirect based on that que...
How to quickly switch custom post type singular template?
wordpress
After changing themes I get <code> Fatal error: Call to undefined function add_editor_style() in /mydir/wp-content/themes/evolve/functions.php on line 8 </code> I cannot even login to the administration panel
Simply Delete or rename the theme's directory.
How do I manually revert back to my old theme?
wordpress
Currently I am working on Wordpress and I want to know can I add 1 more page in admin panel appearance menu so that it looks like this: ? <code> Appearance Themes Widgets Menus Editor </code> I want to add one more page after Editor like "Theme option".
You'd use the add_theme_page() function. Basically, it's the same as adding any other settings page, but instead of add_options_page(), you use add_theme_page(). More info: http://codex.wordpress.org/Creating_Options_Pages http://codex.wordpress.org/Settings_API http://codex.wordpress.org/Adding_Administration_Menus
How to add another page in appearance tab of admin panel?
wordpress
I just got WP running on my own server. I am not trying to lock things down more. What permissions should the db user have to my WP db?
If you did want to lock things down.... a normal wordpress site will usually only require the database user to have SELECT, INSERT, UPDATE and DELETE. If you want to use the automatic update feature it will also require CREATE and ALTER. Some plugins may require other permissions but most won't.
What are the recommended database permissions for WordPress?
wordpress
I'm looking to see if there is already a plugin that does a gallery slide show like Huffington Post does where it shows either one image or video then you click next to see the next one. There is no need for a rating system. I'm hoping there is so I don't have to figure out how to make one :) http://www.huffingtonpost....
FOUND A SOLUTION USING NEXTGEN: Actually someone found this post and they found the solution :) http://gregrickaby.com/2010/07/add-an-anchor-to-nextgen-gallery-image-browser.html
Looking for WordPress Slideshow Gallery Plugin
wordpress
I'm combining two of my plugins into one. I'd like to make the activation routine of the second plugin a checkbox selection in the settings panel of the new plugin. However, I'm unsure how to execute functions when the options are submitted. How can I do this? The my-plugin-options.php is basically this... <code> &lt;f...
If you are using the Settings API , then I'd say to add a check and function call for it in your sanitization callback (from register_setting).
How can I add function calls to my plugin's options.php default submit routine?
wordpress
Specifically, I am making a custom rss feed. I have modeled it after the rss2 feed that is in the wp-includes folder. I can successfully retrieve all posts using the standard query_posts('posts_per_page=-1'). Here is how I am attempting to get just the ones posted in the past year: <code> $today = date('Y-m-d'); $newda...
Hi @Ryan Long: You have two problems: You need to wrap the result of <code> date( 'Y-m-d' , $newdate ); </code> in a SQL <code> DATE() </code> function, and You define <code> $ayearago </code> outside of the <code> filter_where() </code> function so it's not in scope within the function. You need to move the code that ...
How do I correctly get all posts within the last year using the query_posts function?
wordpress
I have been looking for hours for an example on how to do this. I have 2 simple taxonomies, Type, Size. I need to create a custom form with the 2 taxonomies available as Select list/filter. Please help! tx in advance <code> &lt;form role="search" method="get" id="searchform" action="&lt;?php bloginfo('home'); ?&gt;"&gt...
take a look at scribu Query Multiple Taxonomies plugin it creates a drill-down navigation widget
WP Search using taxonomy terms
wordpress
I need to add an additional filter based on a category for posts that have a custom post_type. For example, I have a page located at <code> /category/tasks </code> that lists all tasks. I need to make it so I can have additional pages that filter even further like <code> /category/tasks/current </code> , <code> categor...
If I'm understand the question right.... first login to the admin section. then click on "categories" its in the "Posts" accordion box. When your there you'll see all your categories. Next, following your example, you need to make "current", "future", and "past" all children of "tasks". this should achieve the desired ...
How to detect filter in URL in Category page?
wordpress
I'm really at loss as to why this isn't working: I am using a shortcode to display a query on a custom post type + taxonomy, this is the segment of it: <code> // - arguments - $args = array( 'post_type' =&gt; 'customposttypename', 'taxonomyname' =&gt; 'alpha', 'post_status' =&gt; 'publish', ); // - query - $my_query = ...
Notice: Trying to get property of non-object Would indciate that <code> $post </code> has no scope inside your function. One simple solution here would be to globalise <code> $post </code> so it has scope, effectively fixing the error. However, whenever you create a query, or run the loop and call <code> the_post </cod...
Custom Post Type Loop within Shortcode
wordpress
So basically I have custom post types set up, and one of these is called Packages. It's for a web design/SEO company. I need the nav link Packages to show in the navigation and all of the child links for the link Packages will be all of the posts inside the Packages custom post type. If that's too confusing, just tell ...
Hi @ Jared One idea is to look at the <code> 'rewrite' </code> argument for custom post types. You can also create a <code> [shortcode] </code> and create a page in your functions.php file for displaying the Packages.
Custom Post Types set up, how do I style the main slug page?
wordpress
Hey Folks I have a page called Journal that I would like to filter all my posts from a specific post category.I created a function but am not sure how to do it. I tried get_post etc but it throws a format error and am also now sure what I should be ammending. I realize that I could do this in the main template tag but ...
You need to query them: (for more info see inline comments) <code> /** * Template Name: Journal */ // define( 'TEXTDOMAIN', 'your_textdomain_string' ); // To be sure, we reset the query, so nothing get's lost wp_reset_query(); global $wp_query; $query_cat = new WP_Query( array( 'orderby' =&gt; 'date comment_count' // d...
Posts on a Page using functions.php
wordpress
I need to display something of a mini author statistic in my sidebar on the single posts page. I'm using the PHP code widget, to allow me to insert PHP code into a widget. What I've done is run a loop in the sidebar like this: <code> &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt; &lt;ul&gt; &...
To get the number of posts published by a user i found the solution was to call <code> count_user_posts() </code> , passing in the appropriate user id. <code> &lt;?php echo 'Posts made: ' . count_user_posts( get_the_author_meta('ID') ); ?&gt; </code> In translation ready form. <code> &lt;?php printf( 'Posts made: %d', ...
Show author post count in sidebar - Variable
wordpress
The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more. What there is no documentation for is how to submit to a custom field. I know it is possible with the <code> add_post_meta($post_id, $meta_key, $meta_value, $unique); ...
Hi @ Robin I Knight If you read the documentation for <code> wp_insert_post </code> , it returns the post ID of the post you just created. If you combine that with the following function <code> __update_post_meta </code> (a custom function I acquired from this site and adapted a bit) <code> /** * Updates post meta for ...
WP insert post PHP function and Custom Fields
wordpress
I've created a WordPress 3.0 site w/ MultiSite enabled and the BuddyPress plugin installed (latest available versions of each). Initially, the site did not have a captcha enabled and now there are hundreds of spam accounts created. By default, the Super Admin panel for Users only shows 15 users at a time. I need to del...
Super Admin > Users. Screen Options (top right) > Show on screen __ users. Be careful, listing hundreds of users could kill your server. Heh!
Bulk User Deletion
wordpress
( Moderator's note: Title was originally: "query/database optimisation") I'm written a function for a custom "filter" search panel that allows users to select terms from up to four custom taxonomies. I'm running the queries directly against the database and the query is averaging half a second to execute (with terms fo...
Hi @goatlady: While this is really a MySQL question it does help to understand the WordPress SQL schema and also I love trying to optimize SQL queries so rather than send you off to stackexchange-url ("StackOverflow") I'll try to answer you here. You may still want to post it over there to get some other opinions. And ...
Optimize Multiple Taxonomy Term MySQL Query?
wordpress
Is there a way (plugin, or something else) to set it where there is a drop down on the "New Post" page that allows you to choose a post type and the fields change allowing you to filter what content you are putting into a post without confusing a user by having 20 different custom fields on the "New Post" page. Also, i...
This was asked over and over: stackexchange-url ("Add custom field automatically to custom page types") stackexchange-url ("Redesigning Custom Post Type “Add New” page") and if you are not into coding the you can use plugins like Simple fields More Fields Verve Meta Boxes hope this helps
How to change what the post creation page looks like?
wordpress
Is there a way to mark a plugin as "never upgrade this plugin" ? I stackexchange-url ("can't upgrade my OpenID plugin"), and this prevents me from clicking the otherwise convenient "Upgrade All Plugins" button.
Hi @ripper234: Either 1.) edit the plugin header comment in the main plugin file and change the <code> Version: </code> value to something like 999, or 2.) move the plugin to the "Must Use" plugin directory: <code> /wp-content/mu-plugins </code> . Here's an example from <code> /wp-content/plugins/akismet/akismet.php </...
Disable a plugin from ever upgrading?
wordpress
I can't find much documentation on using XML-RPC and custom post types. I have a specific requirement that remote posting and management (the client has an in-house cms) must be used for a custom post type.
@keatch is correct that out-of-the-box WP XML-RPC does not support post types other than 'post' and 'page'. However, a quick stroll through the code indicates that this may be relatively easy to change. In WP 3.0.4, <code> xmlrpc.php </code> , line 1989, we have the function <code> mw_newPost() </code> (which does the ...
XML-RPC and Custom Post Types
wordpress
I've been having some issues with my Wordpress install allowing me to access subdirectories, specifically a CodeIgniter install at mydomain.com/codeigniter. I know that technically it should work just fine as-is and recognize folders as they are created. However, this is not happening. I suspect it has something to do ...
Even though static files and directories do work with a mod_rewrite'd wordpress installation in the servers root you might need to exclude your CodeIgniter subdirectory from that mod_rewrite lineup. You can do so by placing an additional .htaccess file into the CodeIgniter directory and disable mod_rewrite in there: <c...
Wordpress .htaccess subdirectory problem
wordpress
The last time I stackexchange-url ("asked a question that required an opinion response"), I was awarded the dubious tumbleweed badge. I'm fearful of adding to my collection, but here goes :) I'm considering writing an option into my theme that would force all pages and posts to have a .html extension and all category l...
WordPress › WP No Category Base « WordPress Plugins correctly reverts permalinks because it doesn't alter them in the first place.
If I remove Category base from my URLs, how difficult will rollback be?
wordpress
I'm seeing this box in the "Edit Post" page, using the Simple Facebook Connect plugin 0.25 and WordPress 3.0.4: If you can see this, then there is some form of problem showing you the Facebook publishing buttons... All other Facebook-related plugins are disabled. How can I debug this? Posted an issue .
I added "http://" in the Facebook URL (See the issue for more details).
Problem with Simple Facebook Connect
wordpress
Is there any way to allow logged-in users to post comments without them being held for moderation, while requiring that any comment from anonymous users be approved? I have developed a system for users who are members of our organization to log in automatically with their LDAP accounts, and would like for any of them t...
Here you go, paste this code in your themes <code> functions.php </code> file: <code> function loggedin_approved_comment($approved) { // No need to do the check if the comment is already approved anyway. if (!$approved) { if (is_user_logged_in()) { // Note: 1/0, not true/false $approved = 1; } } return $approved; } // ...
Hold comments for moderation only if user is not logged in
wordpress
Is there a built in function to load scripts only for particular template? At them moment I am doing like so: <code> if (is_page('portfolio') || is_page('gallery')){ wp_register_script('jScrollpane', get_bloginfo('stylesheet_directory') . '/js/jquery.jscrollpane.min.js'); wp_enqueue_script('jScrollpane'); } </code> and...
You can use <code> is_page_template('template.php') </code> and just replace template.php with your template name.
Load scripts only for selected template
wordpress
Is it possible to allow people to utilize their email as their username?
As far as i know it should be possible to login with your email with wp 3.1, which will come soon. Using an email as username is already possible. "@" and "." are allowed characters for usernames. Hope that helps.
Allowing an email as the username?
wordpress
I'm using the Share and Follow plugin on my site. I like it for the most part, but the "interactive share buttons" - the ones that appear at the front of the post - are on the first line of my post. This might be OK, except that it shoves the images that are at the beginning of the majority of my posts out of alignment...
Since it's a plugin you probably don't want to edit it directly as then it will revert every time the plugin is updated. It looks like the problem is that the style has a float:left on it. <code> &lt;div style="float:left; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; " class="intera...
Moving Share Buttons from a Plugin
wordpress
Is there a way to prove information to Facebook so I can control what the title and description information is that comes up when pasting the front page of my blog on facebook? Right now, it seems to grab a random post... not the latest... for th information. I'd prefer to either set the information myself for the fron...
Have you tried adding the Open Graph metadata? http://developers.facebook.com/docs/opengraph/ I think that should give Facebook the right hints.
How to control Facebook share information for the front page?
wordpress
Currently creating a plugin with cURL and I need a place that will work for most WordPress servers (Unix or Windows) to store my cookie file. Anyone have a suggestion or best practices? I've been googling for a while now and I think I found something about wp_temp_dir, but googling that keyword gives me only a thousand...
Transients seem to be appropriate storage. Just note that if you will generate a lot of this and they will be disposable then you stackexchange-url ("will need to cleanup old transients"). As for your cURL/filename issue - it is bad practice to use cURL directly in WordPress. WP provides HTTP API that abstracts remote ...
WordPress Plugin: Where should I put my cookies for cURL?
wordpress
I work at a radio station that has several WP user roles -- for simplicity sake, let's say Admin, Programmer, Subscriber, in decreasing order of ability. Currently, Admin users need to approve comments left by Programmer users. How do I auto-approve Programmer-level comments, without letting that user level administrat...
Role Approved Comment plugin http://wordpress.org/extend/plugins/role-approved-comment/ This plugin will allow any specified role to have their comments automatically approved.
Capability for allowing user to post own comments without moderation
wordpress
I came across stackexchange-url ("this question") while writing this question. I have one question that extends upon that question. I figured out that you use the <code> get_delete_post_link </code> filter to create a new url for my actions (or a similar function -- In any case, I'm using that one with the boolean at t...
The main problem is that $actions accepts the whole anchor tag for the link and get_delete_post_link function outputs just the url. So if You are just looking to replace the label "Trash" then you can use the post_row_actions filter hook with a simple function Something like this <code> add_filter('post_row_actions','m...
Custom Post Row Actions
wordpress
For some reason the below code works until I hit the third page and gives 404. Is it possible to fix it without using any plugins? <code> &lt;?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query('cat='. $id .'&amp;posts_per_page=4&amp;paged='.$paged); while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the...
Try creating a new instance of WP_Query and at the end use wp_reset_query(); like this: <code> &lt;?php $my_query = new WP_Query(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $my_query-&gt;query('cat='. $id .'&amp;posts_per_page=4&amp;paged='.$paged); while ($my_query-&gt;have_posts()) : $my_query-...
Broken category pagination
wordpress
I'm writing a plugin for work because our main website is being ported to WordPress eventually. I've got multiple custom post types planned for this plugin and would like to group them all into one main menu. Basically, I want the "Visitors" link to be placed under "Argus Admin". The other links aren't necessary to be ...
You got it right but you need to wait for WordPress 3.1 where its actually implemented. if you can't wait you can change 'show_in_menu' to false and use add_submenu_page() function define 'argus' as top page and add the Visitors "manually" under Argus Admin menu. so your code would be: <code> $v_args = array( 'labels' ...
Custom Post Type Menus
wordpress
I have a loop to show my custom post type of 'case_studies'. It originally showed all posts until I wanted to just show 3 specific posts. The problem is that it only shows the first post in my list of 'p=54,49,44'. What am I doing wrong? <code> $case_studies = new WP_Query(); $count = 0; $case_studies-&gt;query('post_t...
I think you need to change: <code> $case_studies-&gt;query('post_type=case_studies&amp;p=54,49,44'); </code> to <code> $case_studies-&gt;query_posts( array( 'post__in' =&gt; array( 54, 49, 44 ) ) ); </code> I'd look at this page for LOTS more examples. http://codex.wordpress.org/Function_Reference/query_posts . when yo...
Query of custom post types only shows first post
wordpress
I want to add &amp; reset default value for my theme options while activate and deactivate a theme More clearly something like this <code> if(theme active) add_option(); // add new option to the theme and register default setting for one time only if(theme deactivate) delete_option(); // reset current option and delete...
Hi @haha: I think what you are looking for was answered here: <a href="stackexchange-url Theme Activate Hook
How to add or delete default value theme options while activate and deactivate theme
wordpress
I've read a couple questions/answers on here but still am a little bit confused. My goal: To have domain1.com and domain2.com under one wordpress installation but have different content (separate blogs) accessible through one admin login (domain1.com/wp-admin). I currently have GoDaddy hosting but I'm using document ro...
Hi @centr0: "MultiSite" and "Create a Network" are the same thing in WordPress 3.x. Follow the steps found in Create a Network in a new subdirectory and this tutorial by Otto should show you have to map domains using the WordPress MU Domain Mapping plugin ("MU" is the legacy description of Multisite, just ignore that c...
Multiple blogs, different domain names, one install to rule them all
wordpress
I have a couple blogs / wordpress sites that I post pictures on. I have noticed that most of the pictures I post with the nextgen gallery plug in never show up in google images search. Is there a way to fix this?
Have you filled out the "alt" tags properly. The chances of being indexed are less if the tag is not included. Additionally, the file name for the image should not be "quor7b.jpg" unless it's a photo of a Quor7b. The file name should also reflect the image (e.g. rose.jpg).
SEO images in Nextgen Galleries
wordpress
When you register a custom column like so: <code> //Register thumbnail column for au-gallery type add_filter('manage_edit-au-gallery_columns', 'thumbnail_column'); function thumbnail_column($columns) { $columns['thumbnail'] = 'Thumbnail'; return $columns; } </code> by default it appears as the last one on the right. Ho...
You are basically asking a PHP question, but I'll answer it because it's in the context of WordPress. You need to rebuild the columns array, inserting your column before the column you want it to be left of : <code> add_filter('manage_posts_columns', 'thumbnail_column'); function thumbnail_column($columns) { $new = arr...
Change order of custom columns for edit panels
wordpress
Is there any way to check whether the user has an SEO plugin installed, so as if they do not I can insert my metas etc.
Hi @Liam: , What you are going to need to do is create a list of the top SEO plugins and themes and then document how each implements meta and develop a strategy for each. And/or maybe you can ask your users upon activation if they are using an SEO plugin much like Akismet asks users to enter an API key.
Check if SEO plugin installed
wordpress
How can I allow each user to manage their own terms for a custom taxonomy when logged in on edit-tags page? user will only show &amp; manage terms that only created by him not others for a custom taxonomy. But Admin and editor can manage all. How can I do that? Any help will be appreciated. Thanks.
Thanks for the AWESOME solution MikeSchinkel :D I just did the following updates in the code and it worked like a charm: <code> add_filter('list_terms_exclusions', 'yoursite_list_terms_exclusions', 10, 2); function yoursite_list_terms_exclusions( $exclusions ) { $currentScreen = get_current_screen(); if( current_user_c...
Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
wordpress
I need to display a list of current tasks. Each task has a custom post_type and a start date and end date. Can someone tell me how to modify my query so it will pick up any tasks that have a start date in the past and an end date in the future? (There's another meta_key named 'end_date') Here's my query: <code> $todays...
change your query a bit: <code> $todays_date = time(); $args = array ('post_type' =&gt; 'tasks', 'meta_key' =&gt; ''end_date, 'meta_compare' =&gt; '&lt;', 'meta_value' =&gt; $todays_date, 'orderby' =&gt; 'meta_value' ); $tasks = get_posts($args); </code> and then for each one of this posts get the start_date meta and c...
Custom query for custom post_type
wordpress
I have the following query in WordPress to call custom post meta, everything is working fine, with one exception, whichever query is second is echoing nothing. Sorry for the WordPress post, but for those unfamiliar the ' <code> get_post_meta($post-&gt;ID </code> ' is retrieving the post ID for the first one and then ec...
Try <code> &lt;?php wp_reset_query(); ?&gt; </code> after each function. See Function Reference/wp reset query « WordPress Codex
Non-Closing PHP Query in WordPress Loop
wordpress
Can I create a template and load it without associating a page/post to it in WordPress? The template will list custom posts in XML. [update] I have a jquery carousel that loads an XML file through ajax. I am storing each slide as a custom post type call 'carousel_slide'. I want to create an XML feed with these custom p...
The basic answer - you can easily load template (or any PHP file really) with *drumroll* <code> load_template() </code> . :) As for best way to implement your custom feed, I think it would make sense to do it by analogue with native WP feeds. You register feed name and handler function with <code> add_feed() </code> an...
How to load a template without it being assigned to a page/post?
wordpress
I've a problem with permission. Is there a specific permission to let an user with Editor Role, manage the custom menu of a theme, and only this options? The item that is under Appereance -> Menu, to be clear. I'm using the capability plugin. Must I write a custom hook to enable only the use of custom menu editor ? TIA...
You need to give the editor role the 'edit_theme_options' permission, but that will also unlock other theme options like widgets to those users.
Manage custom menu for an Editor?
wordpress
I'm using custom permalinks "/%category%/%postname%/". Whenever a post title contains quotes or apostrophes they appear in the URL. Can someone tell me how prevent them from appearing in the slug? I am running WordPress 3.0.4.
In WordPress, "---" and " -- " become em-dashes (&#8212; <code> &amp;#8212; </code> ) and "--" becomes an en-dash (&#8212; <code> #8212; </code> ). The sanitize_title_with_dashes() function doesn't catch these. That function uses the databased copy, but the title displayed to the user always goes through a texturize fu...
How to prevent apostrophes and quotes from appearing in permalinks?
wordpress
I've been told by my clients that scheduled jobs are not run some times as expected. I never questioned myself about how wp_cron actually works, I thought it was kinda self-explanatory. But now I doubt it. Codex says that timestamp argument is: the first time that you want the event to occur. This must be in a UNIX tim...
Yes, the event will trigger when the wp-cron process gets run. If something is preventing wp-cron from running, then it won't trigger at all. If you're having it not work, then something about your server configuration is preventing it from working. For these cases, you can generally work around them by adding this def...
wp_schedule_event will it run if timestamp has passed?
wordpress
I have my own custom post type under: wordpress/custom But when I open any item of this post type they open in: wordpress/archives/custom/title Why there's 'archives' and how to get rid of this from my urls? The taxonomy is registered like below: <code> register_taxonomy("our_frontpage_types", array("frontpage"), array...
WordPress will add archives base in the url if it thinks that the page an archive and when i had the problem it was because i named the custom post type and my custom taxonomy the same, is that the case?
Custom post type items open in archives?
wordpress
Currently, in my plugin description, I'm hardcoding... To customize options &lt;a href="options-general.php?page=my-plugin-admin.php"> click here&lt;/a> Is there a dynamic method to call the plugin options page?
You're looking for a plugin settings link that's dynamically generated. This would be one approach. http://wpengineer.com/1295/meta-links-for-wordpress-plugins/
Can I dynamically create a link to my plugin settings/options page from my plugin description?
wordpress
Frustration! Is there an easy to change the RSS title link using the RSS widget to link to the feed instead of the blog itself? It can't be this hard.. I could easily hard code this but I want to keep it as modular as possible.
I don't see any easy way in source. That link is retrieved from feed by SimplePie method and is not passing through any deliberate filters. And it gets concatenated with rest of title after that is passed through filter, not before. The only idea I have is to filter it in <code> esc_url() </code> function at <code> cle...
Changing RSS title link to link to feed instead of blog
wordpress
I have a custom page type set up called 'Products' and I need each of these post to automatically have multiple custom fields to set up a table of features/prices for the individual product pages. Is there any way this can be done? Thanks.
Hi @ Jared I too had a question about this. Luckily, stackexchange-url ("Chris_O") answered it for me. You may also want to check out stackexchange-url ("this question"), too. Here's an example of what I've done with meta boxes and you can see it's quite easy.
Add custom field automatically to custom page types
wordpress
How to add default values for theme options? Currently I use basic option from this site The sample will stored option value in serialize on database. When we activate the theme, there is no value in database at first time until we click Save Changes button. Now I want add default value when theme activate something li...
Loop over your array of options and generate a set of defaults from that.. Let's imagine your array looks something like this.. (but obviously bigger).. <code> $your_options = array( array( 'name' =&gt; 'option-one', 'desc' =&gt; 'Option one description', 'type' =&gt; 'text', 'std' =&gt; 'default_value' ), ..and so on....
Wordpress theme options and insert default value for serialize data
wordpress
I am not sure how WordPress cache the queries. I had the impression that whenever I execute a query through wpdb class, it gets cached. For example, on codex under Select a Row and Select a Var, it says the whole query is cached for later use. And I think which means if more data is requested in another query, partials...
Nope, doesn't work like that. The database-related caching is minimal and mostly covers using precisely same queries during single page load. Best way to cache persistently database and/or computationally intensive results is using Transients API to store results for fitting period of time.
Does a query executed through wpdb class get cached?
wordpress
I've just installed wordpress on our Rackspace server - I've set wordpress up for Multisite as I have done many times before. The main wordpress site at the root functions fine - however when I add a new site and click on either 'backend' or 'visit' I get 'page not found'. Pages in the main site seem to work fine with ...
Yeah the server is not reading the htaccess file properly. may need AllowOverride FileInfo Options in the httpd.conf file for that vhost.
Wordpress 3.0 Multisite - Child sites and backends appearing blank
wordpress
I have my own custom post type, and 15 items there. This code shows all the items: <code> &lt;?php $loop = new WP_Query( array( 'post_type' =&gt; 'my_post_type', 'posts_per_page' =&gt; 15 ) ); while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); ?&gt; (...) </code> When I change posts_per_page to "5" there should b...
Answered a question that's virtually identical to this very recently on the WordPress.org forums. Custom Post Type Archive Page - Pagination Isn't Working I've provided a work-around / fix in that thread that should also work for you to. :) EDIT: You also need to add the paging parameter to your query.. Eg. <code> $arg...
Paging doesn't work?
wordpress
This is a repost of a question asked on stackoverflow, and was referred to this site: My client wants to create a form on his new WP site that when filled out and submitted will be submitted to his admin post queue to approve and if he approves gets posted on his site in the "blog" (which is actually a bunch of guitar ...
you can use plugins fro the front-end posting: Post From Site uCan Post WP User Frontend Or you can create the form yourself <code> &lt;!-- New Post Form --&gt; &lt;div id="postbox"&gt; &lt;form id="new_post" name="new_post" method="post" action=""&gt; &lt;p&gt;&lt;label for="title"&gt;Title&lt;/label&gt;&lt;br /&gt; &...
Anonymous Postings
wordpress
I have a number of slugs and items in my custom category: SLUG - number video - 5 items music - 5 items [no-slug] - 5 items empty - 0 items blabla - 0 items I want to list all non-empty slugs (otpionally with number of items next to them), like: [ video (5) ] [ music (5) ] [ other (5) ] (empty and blabla omitted) Anyon...
Hi @Wordpressor: Sounds pretty simple so I'm concerned I misunderstand, but in case I did understand correctly here's a function; just pass the taxonomy to it like this: <code> echo get_taxonomy_list_html('category') </code> : <code> function get_taxonomy_list_html($taxonomy) { $term_links = array(); foreach(get_terms(...
Listing all slugs?
wordpress
Can someone tell me how to get the time zone that is set in the WordPress Admin? For example, if the blog is set to Eastern time, I need this exact string to print out: US/Eastern This is for a function that lives in functions.php in my theme.
if you need the gmt_offset then <code> &lt;?php echo get_option('gmt_offset'); ?&gt; </code> this will give you an integer like 2 or -2 . and if you need the timezone string use <code> &lt;?php echo get_option('timezone_string'); ?&gt; </code> this will give you a string like America/Indianapolis
How to get WordPress Time Zone setting?
wordpress
here is what i have so far. function zip_gallery() { global $post; $images = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_mime_type' => 'image', )); if ($images) { $save = $post-> post_title; $zip = new ZipArchive; if ($zip-> open($save...
<code> ZipArchive-&gt;addFile() </code> method expects local path to file, while <code> wp_get_attachment_url() </code> returns URL. You need to build local path for file from URL or in other way.
get images from post and make a zip
wordpress
I am working on a client site which is a very stripped down theme. It has no standard html markups as a result of which the reply box doesn't move upto the place of being just below the comment to which you hit the reply button. Can anyone point me to the minimum markup required? I am trying to add classes one by one. ...
You should really use comment_form() instead of rolling your own. Still, if you must, make sure that: The textarea has id="comment". The wrapping container around the entire comment form (probably a DIV) has id="respond".
Comment Reply javascript
wordpress
I'm using a custom post type and custom taxonomies, and using the following to display the terms of the taxonomies on the post page: <code> the_terms( $post-&gt;ID, 'taxname', 'beforetext', ', '); </code> Is there a way to loop through all the taxonomies assigned to this post and display the terms in an unordered list,...
This answer was a joint effort with tnorthcutt so I made it community wiki . There are several interesting functions available: <code> the_taxonomies() </code> , which calls <code> get_the_taxonomies() </code> , which in turn calls <code> get_object_taxonomies() </code> and <code> wp_get_object_terms() </code> . <code>...
Using a loop to display terms associated with a post
wordpress
I just configured my VPS, I am using Centos, everything works fine, but if I am setting my permalinks to Custom Structure, then accept the homepage none of the posts come, it shows me 404 page, I think this is because I haven't enabled curl, but I don't know where is my php.ini file in my centos? OK my curl is enabled,...
You need to add: Options +FollowSymLinks It's often but not always enabled in most hosting environments. We have a server that has it off by default for PCI compliance.
curl problem or permalinks
wordpress
The title pretty much explains exactly what I'm trying to do. If someone could help me out, that would be awesome. Thanks! :)
the correct way to include files for scripts you can use the hook "admin_print_scripts" and include your scripts with wp_enqueue_script() for example: <code> &lt;?php add_action('admin_print_scripts','my_scripts'); function my_scripts(){ wp_enqueue_script( 'jquery' ); } ?&gt; </code> and for styles use the hook "admin_...
Include jQuery (or anything) inside Custom Options Panel's tag
wordpress
Recently I purchased a VPS from intovps.com, And first time I configured a fully unmanaged VPS through ssh comands. My website is working into it, properly. Now I just want to know how to secure it? I started my process of configuring VPS in this way:- Installed LAMP, phpmyadmin, restored the backup(wordpress &amp; mys...
Have a look at this excellent question and answers on Server Fault that discusses how to secure your LAMP stack. Make sure your FTP user can only access the directories you want. Setup sudo to allow a non root user to run commands as root. Lock down your ssh so that root cannot log in set <code> PermitRootLogin = no in...
Secure Server after configuration
wordpress
I've been adding custom post types in the admin panel and endingup with the following results: 1. Prioritazing content: Posts (blog entries, news, events...) Pages Static Content (custom post type) -> Sections (custom taxonomy) (Tagline, Slider, Mainbar...) ... In this case, I divided the pages into sections, the probl...
Hi @janoChen: Definitely #1. #2 will create a lot of complexity for the user. To address the problems you've identified with #1 I would recommend removing the static content post types from the admin and isntead creating a custom admin page that allows the user to add static sections via AJAX with links to their edit p...
Using custom post types to give Wordpress a more CMS-like look. What to prioritaize? Pages or Content?
wordpress
I want to display one post from each category per page. So the first page would contain the first post of cat A, the first post of cat B and the first post of cat C. The second page would contain the second post of cat A, the second post of cat B and the second post of cat C. I currently use the following code, but it ...
If you are only showing one post of each category then in your <code> query_posts() </code> change the <code> &amp;paged='.$paged </code> to <code> &amp;offset='.$paged </code>
Showing one post from each category, paged?
wordpress