question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
In a theme I built from scratch I'm using the WP Photo Album Plus plugin. Per some books I've been using as guides, I need to include this code in the header in order to make comments work in a blog: <code> &lt;?php if ( is_singular() ) wp_enqueue_script ( 'comment-reply'); wp_head() ; ?&gt; </code> I've been including...
This line has wrong syntax: <code> &lt;?php if ( is_singular() ) wp_enqueue_script ( 'comment-reply'); wp_head() ; ?&gt; </code> The call to <code> wp_head() </code> should not be on the same line as the conditional for the comment-reply script. Change it to this: <code> &lt;?php // Conditional to determine if comment-...
Why does this line of code make photo albums appear?
wordpress
I'm making a new theme for a blog that will be slightly narrower. Thus I need to resize every image and also change the image url in every post. Is there any kind of plugin handling this?
This plugin might help you : Regenerate Thumbnails Just change the image dimensions in WP's Media Settings and run the plugin.
How to batch resize images and change image url?
wordpress
I'm trying to add a table to a php page template. The headers and cells contents show well, but the table attributes are being ignored. This code: <code> &lt;table border="1" cellspacing="10"&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt;&lt;span/&gt; &lt;th&gt;Address&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;name_1&lt;/t...
Remove the border="1" attribute but leave the cellspacing. Then go into styles.css and either add your CSS selectors or modify the existing selectors. If your table is within the id="content" block, the styling is being affected by the existing selectors. The ones you will want to adjust are: <code> #content table { bo...
HTML table attributes ignored
wordpress
For a custom post type (review) I have enabled a few custom taxonomies. One of them is author rating and for that I have added images to the description field of the terms in the taxonomy (1 star to 5 stars). Now I am wondering how to show that description instead of the term itself on the <code> single-review.php </co...
If i understand correctly what you are trying to achieve then you can use <code> get_the_terms </code> function to get the rating terms object and from that echo out the description. replace: <code> &lt;?php echo get_the_term_list( $post-&gt;ID, 'rating', __('Author Rating: ', 'appz'), ', ', '' ); // HERE I WANT THE DE...
show term description instead of list terms of custom taxonomy
wordpress
I am wondering how do you create a home page with a custom design like banners different layout from other pages while allowing users to edit it. I used to use <code> home.php </code> problem is user cannot edit it ... unless they know PHP. An option will be to create shortcodes for each section of the home page eg. <c...
First, do not use <code> home.php </code> for this purpose. It is a reserved template file name, and is used to display the Blog Posts Index . Your best option is probably to create a <code> front-page.php </code> template file, and make the output Widget-based, so that users can modify the display via <code> Dashboard...
Allow users to edit home page from WordPress (home.php problems)
wordpress
I was testing a new website with Chrome (latest build), everything working fine (no new plugin installed during the test) when suddendly when I try to post a comment, after pressing the "reply" button it stops on a blank wp-comments-post.php without posting. I am testing on localhost with MAMP. The funny thing is on th...
Problem solved. It was an unclosed div. Lesson learned: first validate your code completely, then ask for help ;)
blank page after submitting a comment
wordpress
been seaching on google for a plugin for this and can't seem to find anything realiable. The only plugin I found is called "old post promoter". Any ideeas? Can this be done with googl old fashion coding, not a plugin? Ty!
http://wordpress.org/extend/plugins/oldest-2-newest-redux/ it takes your oldest post and reposts it in the front every 24 hours, but you can change the hours on the php file in the plugin folder not sure if this is what u are looking for.
Automatically republish old posts
wordpress
I have a running normal WP blog (blog 1). I want to create a Q&amp;A section for my users, so I setup another blog with WP-Answer theme (blog 2). The problem is I don't want my users at blog 1 have to register at blog 2 to post questions. I want they automatically grant the same privileges at blog 2. How can this be ac...
I think you want to install your second site on the same database but with a different table prefix, e.g. <code> $table_prefix = "qa_"; </code> in <code> wp-config.php </code> You are then able to define a custom user and/or user_meta table by adding the following lines to <code> wp-config.php </code> <code> define('CU...
How can 2 blogs share the same users
wordpress
I've never messed with the comments loop before, but I'm trying something out here. Basically, I have my comments form in a popup iframe, an ajax action which handles the form submission, inserts the comment, and updates the list of comments. I'm having a problem running the comments loop a second time on the page, tho...
Ajax handler runs in completely separate instance of WordPress, it has no access to global variable from your pages and such. Basically there is nothing to rewind here, you need to pass those environment variables in request and query for comments from scratch.
How to use rewind_comments() - when and how to use it?
wordpress
On a themes site they stipulate, in the terms and conditions, that their themes inherit the GNU general public license from WordPress. I believe that this means that they can be copied and modified. However the themes are being sold. Shouldn't they be free? Could someone enlighten me.
The GPL absolutely does not preclude selling code, for cost. In fact, the terms of the license explicitly allow for selling of code. The GPL merely allows the end user, whether he received the GPL-licensed code for free or for cost, to use the code however he likes, to redistribute the code, to modify the code, and to ...
Wordpress themes under GPL license
wordpress
How can I permanently disable pingbacks on my wordpress multi user installation? I have disabled access to the wp-trackback.php file through permissions (chmod 000 trackback.php) thinking this would stop any pingbacks from being received. I do not want to run any SQL queries on the posts table, as there is a separate p...
Put this in a network activated plugin. <code> add_filter('pings_open','__return_false'); </code> No more incoming pings.
How do I permanently disable Pingbacks?
wordpress
I have two different kinds of search results on my site and I'd like to change the look of the search result page entirely. I've played around with the search form a bit but I'm unsure how to force it to redirect to an alternate search.php Any help would be appreciated <code> &lt;form role="search" method="get" id="sea...
you can add an hidden filed to your search form and include a different template based on that: <code> &lt;form role="search" method="get" id="searchsupport" action="/"&gt; &lt;label class="screen-reader-text" for="s"&gt;Search for:&lt;/label&gt; &lt;input type="text" onfocus="if (this.value == 'Search') {this.value = ...
Varying Search Result Pages
wordpress
I'm using the advanced custom field plugin to convert WP into a CMS (it's works brilliantly for this). There's just one issue - with an image field it's not quite a smooth process as images need to be selected twice, this causes user confusion. Rather than me up all the images again - please see here for step by step p...
This has now been solved. It was a case of fixing the http error I was getting with the flash uploader. It then gives you the select button rather than the insert into post.
Unable to select image with custom field
wordpress
The default Archive widget display monthly archives in a dropdown. I would like to limit the number of months to 12 (in dropdown). What filter I should apply in my functions.php? I tried this, but it gives me parsed error: <code> add_filter('WP_Widget_Archives','set_number_months'); function set_number_months($args) { ...
Use the <code> widget_archives_args </code> filter to add the archives limit. <code> function my_limit_archives( $args ) { $args['limit'] = 12; return $args; } add_filter( 'widget_archives_args', 'my_limit_archives' ); </code> And to limit the number of months in Archives widget dropdown use the following drop down fil...
Archive widget - limit number of months to 12
wordpress
When I use <code> wp_nav_menu(array( 'theme_location' =&gt; 'mainnav', 'container' =&gt; 'nav', 'container_id' =&gt; 'mainnav', 'container_class' =&gt; 'clearfix', 'depth' =&gt; 4 )); </code> If the user hasn't set a nav menu under Appearance menu, I notice theres a fallback like <code> &lt;div class="menu"&gt;&lt;ul&g...
The default fallback menu is created with wp_page_menu() function and if you want to customize it the you need to create your own fallback function : <code> function my_fallback_menu(){ $args =array('whatever'); wp_page_menu($args); } </code> and then call that function in your wp_nav_menu call as the fallback: <code> ...
wp_nav_menu and its fallback
wordpress
I am using contact form 7 plugin in my blog.I am having donate option in the form with price option in radio button. user can select and submit.After submitting the form it should redirect to the paypal. with selected price . i tried on_sent_ok: "location = 'https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_xclick&...
First change the `on_sent_ok' to: <code> on_sent_ok: 'my_redirect();' </code> then create that <code> my_redirect() </code> function in the page that displays the form: <code> &lt;script&gt; function my_redirect() { var price = document.getElementById('PRICE_FIELD').value; var url = 'https://www.sandbox.paypal.com/us/c...
get values from contact form 7 wp plugin
wordpress
I am in the process of creating a wordpress mobile theme for one of my wpmu networks. I have created 2 + pages that show our other sites and a custom login form. Right now i have labeled them page-other-sites.php and page-login.php and created 2 pages in the backend. When you click on the link it loads the page-(slugs)...
So instead of creating a theme for it i ended up using the <code> template_redirect </code> with an if statement to check the url for a certain thing. <code> function page_redirect() { if ($_SERVER['REQUEST_URI'] == $home . '/other-sites') { require(TEMPLATEPATH . '/includes/other-sites.php'); } if ($_SERVER['REQUEST_U...
Create a page for a theme only
wordpress
I have custom post-type 'sermon' with custom taxonomy 'speaker' attached to it. I wanted to assign custom meta values to the speaker taxonomy, so I am using the taxonomy meta class from Rilwis: http://www.deluxeblogtips.com/p/taxonomy-meta-script-for-wordpress.html I have used the class to add a metabox with the id of ...
you can use the <code> get_the_terms() </code> function to get the terms of that post in a specific taxonomy: <code> $terms = get_the_terms( $post-&gt;ID , 'speaker' ); //change speaker to whatever you call your taxonomy //then you can use just the first term $term_id = $terms[0]-&gt;term_id; </code> and now you have t...
Get the term id belonging to custom taxonomy on a custom single-post-type.php template page
wordpress
How do I create a simple dropdown menu with 3 options in a widget? I'm using $instance to do it. How would it look in a barebones widget?
This is what I do: Static Options <code> &lt;select id="&lt;?php echo $this-&gt;get_field_id('posttype'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('posttype'); ?&gt;" class="widefat" style="width:100%;"&gt; &lt;option &lt;?php selected( $instance['posttype'], 'Option 1'); ?&gt; value="Option 1"&gt;Option 1&l...
How do I create a drop down menu in a widget?
wordpress
I was thinking about creating a network of user-created blogs. I've read somewhere about wordpress multisite feature, and i was wondering if this is what i'l looking for... What i need to do is create a website where users register and create their onw blog. Does wordpress multisite offer this feature out of the box ? ...
WordPress multisite sounds exactly like what you are looking for. It takes a little work to get multisite set up, but once that's done, the options for allowing anybody to register and create a new site are built right in. See http://codex.wordpress.org/Create_A_Network for setting up a multisite instance.
Multisite features
wordpress
Is there a way to hide the comments column in the backend? When you look at the pages, there's a comments column even though I'v disabled them. I made WP into a cms and it may cause some confusion.
Try this: <code> add_filter("manage_edit-page_columns", "my_page_edit_columns"); function my_page_edit_columns($columns){ unset($columns['comments']); return $columns; } </code> If you need it for posts instead of pages, use <code> manage_edit-post_columns </code> instead. The same goes for any post type, really, as <c...
Hide comments column in WP backend
wordpress
I've made WP into a cms and there's a few niggling things that cause confusion. The main one is that when you create a page, you have to first select a template then enter a title then save as draft for it to show the correct fields on the page (I'm using the advanced custom field plugin). Is there any way to get aroun...
Why are custom fields conditional upon the Page template? Wouldn't an easier, more elegant, and more intuitive approach be to use Custom Post Types ?
CMS - User confusion when creating new page and having to select template and save first to see correct fields
wordpress
For some reason the WP_Query instance in my shortcode function won't take the query attribute sent from the shortcode. The shortcode is like this: [postlist query="post_type=any&amp;posts_per_page=5" style="list"] Here's the code. <code> function hey_query_shortcode( $atts ) { extract( shortcode_atts( array( 'query' =&...
Sorry I deleted my comment because I found the issue. You need to do an html entity decode on query variable. Use the code below. <code> function hey_query_shortcode( $atts ) { extract( shortcode_atts( array( 'query' =&gt; '', 'style' =&gt; '' ), $atts ) ); $query = html_entity_decode( $query ); ob_start(); $the_query ...
Trouble passing attribute into shortcode function
wordpress
Does Wordpress have the ability to use the currently defined template to serve up content in the database? For example, I have a database of a bunch of custom content-- the name of an item, the price, etc. I want all requests for http://myshop.com/buy/ * to be redirected to the plugin (so that the plugin handles the co...
There are two different things happening here. I'll start with your second example, as that's easier. Most shopping carts, in your example WP-Ecommerce, create placeholder pages with a shortcode for things like the cart page and checkout page. All they're doing to handle that is creating a shortcode function and insert...
Have Plugin Handle Specific URLs
wordpress
When I build a theme from scratch I have to "enable" sidebars and specific menus in the functions.php. Similarly, do I need to "enable" access to the javascript and jquery libraries that come bundled with WordPress? I ask because 2 How-to books I've been using (WordPress 2.8 Theme Design, and Beginning WP 3) both talk ...
If you'll be using jQuery in your theme you need to "enqueue" it. If you do not need the JS , ie if you do not run custom jQuery plugins, you don't need to "enqueue" it via wp_enqueue_script
Custom Theme Design: do I need to "enable" jquery/javascript libraries?
wordpress
I've been playing around with the jquery plugin Fancybox on this page, but for some reason since making a few changes my page seems to be displaying blog archives rather than the normal content it should be displaying. I just wondered whether people have had a similar problem? There must be something I've done wrong fo...
Does slideshow-home.php has a loop as well? You need to ensure that you reset the queries or rewind posts while using multiple Loops <code> &lt;?php wp_reset_query(); ?&gt; </code> Multiple_Loops Reset Query
Page is displaying blog archives
wordpress
I use the Google XML Sitemaps (Wordpress Plugin) and the latest wordpress version. Recently i have had a lot of 404 not found errors in webmasters. The urls show up without any categories and it links to the sitemap.xml file. It shows the url as http://mysite.com/welcome-to-my-site/ instead of http://mysite.com/general...
the XML sitemaps plugin should be pulling your URL structure that you've set in the permalinks setting. Are you using a plugin or other method to remove the /category-name/ from the URL?
Getting lots of errors with sitemap on google webmasters
wordpress
Im just wondering if its possible to create user role that allows to write/edit custom post type for example: Consultants, but not allow to write normal posts (used for as news for example). I know that if user wants to edit posts its a must to have edit_post enabled for him. Question is if i can create something like:...
I suspect that Justin Tadlock's Members Plugin would make this very easy for you.
User roles - enable custom posts disable posts
wordpress
This may be more of a php best practices question, but here goes... I am using a custom excerpt trim function: <code> function new_wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace(']]&g...
I'd simply set a flag as second input argument for the function: <code> function new_wp_trim_excerpt( $text, $case = 'plain' ) { switch ( $case ) { default : case 'plain' : // do stuff - your function so far break; case 'image' : break; } } </code> Notes: Avoid names like <code> class="moarplz" </code> . It's hard to r...
Custom excerpt function re-factoring
wordpress
What I'm looking to do it get the 16 latest posts from 16 different authors. In other words there would be the 16 latest posts, but no one single author would have more that 1 post on the page. The way I've thought about doing it, is looping through all the authors, removing the duplicates, then limited that to 16 and ...
Use a custom SQL query to grab the latest 16 post IDs with unique authors; <code> $post_IDs = $wpdb-&gt;get_col( "SELECT ID FROM $wpdb-&gt;posts WHERE post_type = 'product' AND post_status = 'publish' GROUP BY post_author ORDER BY post_date DESC LIMIT 16" ); </code> Then start up a new query with the <code> post__in </...
Find most recent authors
wordpress
I want to allow users to upload images for use in a rotating banner. I tried using the media library, stackexchange-url ("but didn't get much help") ... So I thought, I'd just implement the upload myself. But I encountered another problem... I am using the settings API they do the update options and stuff for me. How c...
You should only need a list of URL's selected from the Media Loader. There are others out there, but I have a Theme Options Panel for your admin that is Settings API compliant. It has an 'upload' option that uses the Media Loader to upload a file and fill a text field with the returned URL of that file. This is saved a...
How to upload images using Settings API
wordpress
Is there a plugin with the social media share buttons where I have more control of where to place them? At the moment, the only one's I can find only allow you to place the buttons at the top or bottom of pages/posts. Ideally I'd like a snippet of code to just place wherever I wanted.
I finally came across one that wasn't over the top and there was also a manual function: http://wordpress.org/extend/plugins/wp-social-bookmarking-light/
Plugin - Social media share buttons
wordpress
I have a custom post type without title support and I'm trying to generate one from post's taxonomies and custom fields. To do so, I'm using this code: <code> function custom_post_type_title_filter( $data , $postarr ) { if ($postarr['post_type'] == 'cars'){ $id = get_the_ID(); $engine= ', '.get_post_meta($id, 'Engine',...
You can try the following code. <code> function custom_post_type_title ( $post_id ) { global $wpdb; if ( get_post_type( $post_id ) == 'cars' ) { $engine= ', '.get_post_meta($post_id, 'Engine', true).'l'; $terms = wp_get_object_terms($post_id, 'brand'); $abrand= ' '.$terms[0]-&gt;name; $amodel = ' '.$terms[1]-&gt;name; ...
Custom Post Type with Custom Title
wordpress
I looking at the docs for <code> add_meta_box </code> . They used a nonce. <code> wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' ); </code> I am wondering, probably the save post form itself should already have a nonce so this is redundant?
Yes, the save action has a nonce already. But you don’t know it – so you cannot validate it. Besides that, you may want to fill a meta box from other places like a user profile or the dashboard, and then you need your own nonce anyway. An example from my current work: There is a custom post type <code> domicile </code>...
Is there a need for nonce with Post Metabox?
wordpress
Suppose I store all my post meta data in an array like <code> $meta = array( 'img' =&gt; '', 'caption' =&gt; '' ); update_post_meta($post-&gt;ID, 'theme_banner', $meta); </code> Can I query posts where the img is filled?
Short answer: NO! I've asked a similar question before stackexchange-url ("mysql order by serialized data")? and the answer i got is: The only possible case when serialized data is acceptable is when you don't need to search , filter or order by through that data. In all other cases - store your data as a separated fie...
Metadata Query when storing data as array possible?
wordpress
I would like the htaccess rewrite rule to compare to IIS rewrite rule I tried which doesn't seem to work: <code> &lt;rule name="rewrite /blog/"&gt; &lt;match url="^blog/([_0-9a-zA-Z\-]+)/$" /&gt; &lt;action type="Rewrite" url="/{R:1}/" /&gt; &lt;/rule&gt; </code>
This is not a WordPress question. Anyway … <code> RewriteRule ^blog/(.*) /$1 [L,R=301] </code>
How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
wordpress
Instead of having an email on every comment on a blog post I've wrote, I'm looking for a visual notification on wordpress itself, an "inbox" if you get what I mean. Does that exist? Thanks, Dennis
This should be visible by default on your WP admin dashboard under "recent comments". is there something else you're looking for it to do?
Alternative to email notification system?
wordpress
I am using this wordpress Script to add metaboxes under posts.. I followed as it was written.. but I am having trouble on how to get those values in singe.php Example an uploaded image Please guide me on this..
<code> &lt;?php if ( get_post_meta($post-&gt;ID, 'your_metabox_id', true) ) : ?&gt; &lt;?php echo get_post_meta($post-&gt;ID, 'your_metabox_id', true) ?&gt; &lt;?php endif; ?&gt; </code> The trick is to use get_post_meta hook
How to get the value of particular get $meta value in wordpress
wordpress
The following code is supposed to allow for a shortcode that includes many attributes, but not all of the attributes may always be present in which case I do not want the containing element to show anything. However, with or without the conditional statements, when I upload my functions file I receive only a blank page...
your conditional breaks the concatenation of the strings (which is not in your code, anyway) try to re-write this section: <code> function info($atts, $content = null) { extract(shortcode_atts(array( "name" =&gt; '', "image" =&gt; '', "address" =&gt; '', "phone" =&gt; '', "email" =&gt; '', "website" =&gt; '', "descript...
Can shortcodes contain conditional statements? Even without them my shortcode renders blank page
wordpress
There're the functions <code> get_theme_data(); </code> &amp; <code> get_plugin_data(); </code> - which both use <code> get_file_data(); </code> that needs a specific file as <code> $input </code> . I got a set of classes that may be used by a plugin or a theme, without a specific location. Everything works, but I don'...
How do get the comment header data of a theme OR plugin... ... that holds a specific class. The following shows how you can drop a class inside any plugin or theme and still be able to get any theme or plugin data from the comment header. This is useful for updating settings/db-options for example. You don't know: if i...
How to: get main plugin/theme file?
wordpress
I'm in need of a forum plugin for Wordpress that has an option for a private forum that is only accessible (both for reading and posting) to registered users. Restricted posting appears to be de rigueur , but restricted viewing appears to be harder to find. Ideally, it'll integrate directly with Wordpress but if it nee...
Simple:Press Can limit forums to no access, read only, limited, standard, full, moderator It's decently simple, I've been using it a bit for my personal blog. I didn't have too hard of a time integrating it. Lots of features available, with pretty fine grained ability to turn things on and off Also, as information, bbP...
Forum plugin with private forum option
wordpress
I have a wp_query that works great but I can't have both a meta query and a tax_query in it. <code> &lt;?php $event_query = new WP_Query( array( 'post_type' =&gt; 'event', // only query events 'meta_key' =&gt; 'event-date', // load up the event_date meta 'orderby' =&gt; 'meta_value', 'order' =&gt; 'asc', // ascending, ...
The query looks about right and I know that <code> meta_query </code> and <code> tax_query </code> work together just fine. the only thing i can think of is that you are query taxonomy by slug and passing the term id which are two different things, change: <code> 'field' =&gt; 'slug', </code> with <code> 'field' =&gt; ...
How to create a wp_query that contains both meta_query and tax_query
wordpress
I am looking for the code that renders the below page. Where can I find it, it does not appear to be in functions.php? I want to learn how they allow users to upload images
The code you are looking for is in functions.php (line 106 to 211). To understand what they have done in TwentyTen, I would suggest that you read the following: http://codex.wordpress.org/Function_Reference/add_custom_image_header
Looking for the code in twentyten that allows users to select images for the header/banner
wordpress
I'm trying to put my own function in a widget but it doesn't run. I want to use it everywhere within the widget. If I could see an example,that'd be great.
there are a few way to run a function in widgets: option 1 - ShortCodes You can create a custom shortcode and run that function by entering the shortcode into a simple text widget: <code> //this is to make sure WordPress renders the shortcodes in a text widget add_filter('widget_text', 'do_shortcode'); add_shortcode('m...
how to put functions inside of widgets
wordpress
I'm using different method to form a gallery in Wordpress, so I would like to hide an option to insert images and galleries into post for anyone but Administrator. Can someone show me an example how it's done?
If you actually wanted to remove it instead of just hiding it you could remove the 'admin-gallery' script that is used to insert the gallery settings form. And if you wanted it to be remove only for non-admins then something like this should work: <code> function disable_wp_gallery() { if( !current_user_can('manage_opt...
Hide "Gallery Settings" and "Insert into Post" button from Attachment window
wordpress
I have a feature in my current project that will be allow multiple ajax requests - I've got a single nonce request worked out (via this tute ), but am somewhat unsure how to figure in multiple nonce requests. functions.php: localize, create a single nonce <code> wp_localize_script( 'B99-Portfolio', 'B99ajax', array( 'a...
That is basically the way WordPress does it and pretty much the only way to do it, simply have your receiving PHP function create a new nonce add send it back with your response, then just update the value on your JS before the next round.
Multiple ajax nonce requests
wordpress
So, I'd like to add some custom write panels when you go to write a new post in the WP admin. I'd like it to have a heading for each, and then a text input field where I can write in some text. I would need it to be inserted into the single.php file, and then output as a definition list. So, each custom field heading w...
The Metabox Script for WordPress has been of great help to me: http://www.deluxeblogtips.com/p/meta-box-script-for-wordpress.html You will be able to ouput all that you shown above and more too. Completely customizable to your wishes.
How to Do Custom Fields to Output a Definition List
wordpress
I am new to WP. What i allready have - I am building a news blog with few posts categories. each category function as a different section (Economics, Sports etc.) What i want to achieve- What i am trying to achieve is to set a static page that will preview the last post from each category and will serve as the main pag...
You will need to set a Static Page as your front page, create and assign a PHP Template for that page, and stack multiple Queries in the template to search out your required categories and display them. Here is one, you might have many: <code> // get the last post (any date) from 'Featured' category $featured = new WP_...
previewing my posts on static page?
wordpress
I'd like to enqueue scripts only for an admin page that I've created. There's an example of this here: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_scripts_only_on_plugin_pages But it's not working for me, I think because I'm writing my plugin within a class. add_action only works with in the co...
Instead of hooking into <code> admin_print_scripts </code> only , you should hook into your specific page slug which is appended to <code> admin_print_scripts- </code> . (note trailing hyphen). The reference page you linked to shows this, but you seem to be omitting the <code> $page </code> concatenation to <code> admi...
Adding Scripts in the Admin Area
wordpress
I'm embarrassed to say that I am a bit clueless on the procedure used to update a plugin via tortoise svn even though my plugin has been on the repository for years and had over 300,000 downloads! there's a lot of questions about svn here but they've only confused me further :-z somehow I've managed so far but I need t...
I'm embarrassed to say that I am a bit clueless on the procedure used to update a plugin via tortoise svn even though my plugin has been on the repository for years and had over 300,000 downloads! Don't be. SVN can be tricky for a lot of people ... so let's go through things step-by-step ... This is what I've been doin...
what is the correct way to update a plugin via tortoise svn to the repository?
wordpress
trying to convert a plugin I wrote to use wp_http instead of Curl (so it'll work on servers without curl) the plugin posts to paypal nvp api and gets back an encrypted button when I try to use the WP_Http class i get "Invalid HTTP Response for POST" would be glad for any help figuring this help - since I want to make t...
Looking at your original code, I'd say you need to add the <code> sslverify </code> arg. And on a side note, use the HTTP functions available, rather than instantiating the class yourself (you shouldn't have to load the class manually). <code> wp_remote_post( $url, array( 'sslverify' =&gt; false, // this is true by def...
problem using WP_Http with paypal nvp api
wordpress
I'm am attempting to change the rewrite argument after it has been defined and passed as an argument for 'register_post_type' in a plugin. My issue is that I am utilizing a plugin that defines a custom post type. I can manually edit the rewrite argument in the plugin; however, doing so will mean that I have to do this ...
I had a very similar question and found the answer. Take a look, it might be helpful for You aswell: stackexchange-url ("SOLVED: Change custom post type to hierarchical after being registered")
Changing 'rewrite' argument after custom post type is registered
wordpress
I'd like users to be able to create and remove additional meta box fields as needed. For example, say a music podcast with a variable amount of songs played per episode. The user should be able to click a button that will add additional fields to enter each song as needed. Ideally this would be done without the use of ...
So you mean something like this? and when you click on Add tracks it becomes this: if it is what you mean the its done by creating a metabox that has simple jquery function to add and remove fields in it, and the data is saved as an array in of data in a single meta row, here you go: <code> add_action( 'add_meta_boxes'...
Create more Meta Boxes as needed
wordpress
I have some custom-made widgets: <code> echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo $output; echo $after_widget; </code> Let's assume the $title is "Widget's Title" and the output is "Hello world". I'm getting something like: Widget's Title Hello world Now, I don't know where it ...
It's the default behavior of a dynamic sidebar to output li tags around widgets. You can override that though in the sidebar declaration . You would do that by passing the sidebar registration the following additional arguments: <code> register_sidebar( array( 'before_widget' =&gt; '&lt;div id="%1$s" class="widget %2$s...
Widget's container?
wordpress
In my header I use this code: <code> if(is_page("stores")) { // Do something } </code> I run some code if on the page <code> stores </code> but what I want to do is run that code if the page is <code> stores </code> or any page that is a sub page of stores. Not only that, but is recursive so if we are on a sub sub sub ...
When using pretty permalinks, I simply check against the request; <code> if ( preg_match( '#^stores(/.+)?$#', $wp-&gt;request ) ) { // away we go! } </code> No extra DB queries, little computation, and works right down the tree!
A function like is_page() but returns true if on any sub page of given page
wordpress
I just bought and installed the WP-Facebook-AutoConnect plugin but I am unable to login. Below is the debug log I got by email. <code> ---LOG:--- Starting login process (Client: 178.156.161.15, Version: 2.0.4, Browser: Chrome 13.0.782.15 for Mac) PREMIUM: Premium Addon Detected (#671, Version: 22) WP: nonce check passe...
I used the premium plugin and I had to solve the following problems: remove the application from facebook, because initially I allowed access to the proxied email address. Verifiy that your facebook account is a verified account before adding the application, otherwise the application will default to proxied emails ins...
WP-FB-AutoConnect: Unable to login with administrator account
wordpress
How can I change the standard 7MB upload limit? I have full shell and admin access to my Wordpress blog.
add this to your .htaccess file in the root of WordPress installation directory: <code> php_value upload_max_filesize 20M php_value post_max_size 20M </code> and you can change 20 to whatever you want, unless your hosting server is limiting it it should work just fine. Update: Create the php.ini File and add the Follow...
Setting higher upload limit
wordpress
Is there a convenient and configurable way to alternate between different header images? The main features I'm looking for are: Random select from a set of images Specific header image in given date range (a la Google Doodle ) Specific header image for specific posts or pages
You can try this Random from a set of images : <code> &lt;img src="http://www.mywebsite.com/images/image_&lt;?php echo rand(1,10); ?&gt;.jpg" alt="" /&gt; </code> This would load a random image from image_1.jpg, image_2.jpg ... to image_10.jpg or <code> $images = array("cool_image.jpg", "nice_pic.jpg", "sunset.jpg"); $...
Alternate header image
wordpress
How would I do this? <code> archive.php </code> only has this: <code> wp_get_archives('type=monthly'); </code> And <code> wp_get_archives() </code> does not have a parameter to display all post types. Also I think <code> archive-[post_type].php </code> is not the one I am looking for since I want all post types to be d...
If you set up the right parameters for your custom post type using <code> 'has_archive' =&gt; true // Will use the post type slug, ie. example // or 'has_archive' =&gt; 'my-example-archive' // Explicitly setting the archive slug </code> http://codex.wordpress.org/Function_Reference/register_post_type
Display all custom post types in archives.php
wordpress
I'm queueing several scripts in my themes Functions.php: <code> if ( ! function_exists('b99_init_scripts') ) : function b99_init_scripts(){ if ( !is_admin()){ wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', false, null, false); wp_enqueue_scrip...
I would suggest creating a function named <code> b99_register_scripts() </code> and hook this into <code> init </code> . Then you can create another function named <code> b99_enqueue_scripts() </code> and hook it into <code> wp_print_scripts </code> .
Correct place to register and enqueue scripts
wordpress
I want to change the name and menu_name of the profile menu in the default menu without altering the core files.
you could filter gettext to change it. Note that this will change every translatable instance of "Profile". <code> function change_admin_profile_to_account( $thename ){ $thename = str_replace( 'Profile', 'Account', $thename ); return $thename; } add_filter( 'gettext', 'change_admin_profile_to_account' ); </code>
Change name & menu_name for Profile in the default menu, w/o altering core files?
wordpress
I have posts which i would like to put in to 3 categories News, Events, and Press Releases, then i have three pages which are using the same template. I would like to display those posts on to relevant pages so News posts on News page etc. Could someone tell me what would be the best way to do that. I guess its somethi...
You could simply use the category pages WordPress generates using the <code> category.php </code> template, or <code> category-{slug}.php </code> . If you don't like the /category/categoryname/ url format WP uses, there are a few plugins that remove the category base- I use Yoast SEO plugin for this, which gives you lo...
post categories
wordpress
I have a shortcode that contains a form. I want to use jQuery/Ajax for POSTing. For this, I want to add javascript to the page where shortcode is added? Which hook should I use? wp_enqueue_scripts wp_print_scripts wp_print_footer_scripts
You want to use <code> wp_enqueue_scripts </code> , but you'll probably first want to: Loop through the Posts Grep your shortcode Enqueue the script, if shortcode is found Rewind Posts That way, you only enqueue the script where necessary.
Which hook to use when adding ajax to viewer-facing side?
wordpress
If WP_DEBUG is not set, as I understand it, you should never ever see warnings. But on some sites on some servers, I'm still seeing a few. Not all the warnings that would be displayed if WP_DEBUG was set, but a select few. I've tried changing the error level in php.ini, but that seems to have no effect on whether warni...
WP_DEBUG has no impact on PHP error output. In addition to error_reporting setting, set display_errors=0 in your php.ini file. It's enabled by default for development. But you'll want it off on production servers.
WP_DEBUG is not set, but I'm still getting warnings
wordpress
My WP site has 2 custom post types, "Projects" and "People". There can be unlimited number of "People" per project and I'm thinking about a way to integrate the projects section with "People" section. My first impression was using custom taxonomies. But the problem is, is there a way to set a relationship between these...
As you haven't stated your requirements of People type and Project type. So I am assuming that you must have both as a post type. To create relations between them you can use @scribu's Post 2 Post relations plugin.
Custom post type with custom taxonomy
wordpress
What should I call the archive file for a post format? Ex archive-gallery.php? (doesn't work) I would like to create a list of all the gallery formats with a preview and some custom taxonomies thrown in.
Well.... for querying, formats are a taxonomy parameter...so that should work.... http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters Lemme loook... And yep, here's how that works http://codex.wordpress.org/Template_Hierarchy#Custom_Taxonomies_display taxonomy-post_format-post-format-link.php
Post Format Archive template name for theme folder?
wordpress
I have events that have an event-date custom field. I want to create a date based page to display all events for a given day, and my hope was to use the url to help with that. I have a 7 day calendar working, and it shows a "featured" event for a given day. Then I want to link to a page that shows all the events for th...
Assuming that your event rewrite slug is event and you want your datebased URLs to look like: http://domain.com/event/2011-06-14/ <code> function custom_permalink_for_my_cpt( $rules ) { $custom_rules = array(); // a rewrite rule to add our custom date based urls $custom_rules['event/([0-9]{4}-[0-9]{2}-[0-9]{2})/?$'] = ...
How to give a CPT (custom post type) a date based url
wordpress
I'm building a menu which contains categories. Is there a way to make each menu option show a list of recent posts in that category when you hover over it?
you can use a walker like this, <code> class Walker_Recent_Post_Category extends Walker_Category { function start_el(&amp;$output, $category, $depth, $args) { extract($args); $cat_name = esc_attr( $category-&gt;name); $cat_name = apply_filters( 'list_cats', $cat_name, $category ); $list_recent_cat_post = '&lt;ul class=...
Show recent posts in menu?
wordpress
<code> http://localhost/lyrics/don't-turn-me-away/ </code> is a custom post type. my question is how to display <code> http://localhost/lyrics/ </code> as a page and not an archive? my goal really is just for it be added to <code> wp_nav_menu </code> . I have created a page named <code> lyrics </code> but it won't dire...
Look for this in the code where you registered the lyrics post type: <code> 'has_archive' =&gt; true, </code> Set <code> 'has_archive' =&gt; false </code> . That won't work right away, however. So you need to go in an "refresh" your permalinks. Just go to the permalinks options page, and hit the save button.
archive as a page, so that it can be added in the wp_menu_nav
wordpress
After much research, I think I can wrap my brain around WP's rewrite system. I would like to know, though, how to properly test rewrite rules to see if the right rule/tags is being used and the right query vars are being passed. Is there a way to create a temporary template that supersedes everything in a theme whose s...
Check out my favorite Rewrite Analyzer plugin written by @Jan Fabry. It allows you to analyze your rewrite rules and really helps in debugging those rules.
How to test custom rewrite rules /permalinks?
wordpress
I'm using php to dynamically create a custom post, and I need the author to be someone other than the logged in user. I found this stackexchange-url ("stackexchange-url but I'm wondering if there is a way to do it after the post is already inserted. I guess I could just do a db query...
If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it. <code> $id = $post-&gt;ID; // change this to whathever $user_id = '4'; // change this too $the_post = array(); $the_post['ID'] = $id; $the_post['post_author'] = $user_id; wp_insert_post( $the_post ); </code> The trick...
how can I set the post author of a post I just created with php?
wordpress
My source links are something linke this : <code> http://sample.com/entertainment/default.aspx?tabid=2305&amp;conid=102950 http://sample.com/entertainment/default.aspx?tabid=2418&amp;conid=104330 http://sample.com/entertainment/default.aspx?tabid=2429&amp;conid=104264 http://sample.com/entertainment/default.aspx?tabid=...
To save the link in the post meta you can use <code> update_post_meta </code> like this for example: <code> $url = "http://sample.com/entertainment/default.aspx?tabid=2305&amp;conid=102950" $my_post = array( 'post_title' =&gt; "$title", 'post_content' =&gt; "$content", 'post_status' =&gt; 'draft', 'post_author' =&gt; 1...
Prevent duplicate posts in wp_insert_post using custom fields
wordpress
is there any way to easily update a plugin installed on multiple sites from a github repo. I know I can do it from the command line of each server using git pull. but is there a way to do it from the wordpress admin similar to how plugins are updated?
I wrote a PHP class that allows a plugin developer to incorporate updates from GitHub within their plugin. Here's a link for it -> https://github.com/jkudish/WordPress-GitHub-Plugin-Updater
How can I update a wordpress plugin from a Git repository (github)
wordpress
My for-fun WordPress blog at http://fakeplasticrock.com (running WordPress 3.1.1) got hacked -- it was showing an <code> &lt;iframe&gt; </code> on every page like so: <code> &lt;iframe src="http://evilsite.com/go/1"&gt;&lt;/iframe&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht...
Have you identified the exploit vector? If not, you may be leaving yourself open to future exploit. Other things to consider: Change WordPress admin user passwords - done Change Hosting account user password Change FTP passwords Change MySQL db user password - done Change the db table prefix Update your wp-config nonce...
Verifying that I have fully removed a WordPress hack?
wordpress
Each time I register I end up in the wp-login page (back-end): Is there any way of redirecting the users who register to a page template (front-end)?
You can use the filter <code> registration_redirect </code> to pass back your own URL, for example; <code> function __my_registration_redirect() { return home_url( '/my-page' ); } add_filter( 'registration_redirect', '__my_registration_redirect' ); </code> Drop it in your <code> functions.php </code> or a plugin :)
How to redirect a sucessful registration to a page template?
wordpress
How do I add a class to the comment submit button? The simplified function <code> comment_form(array('id_submit'=&gt;'buttonPro')); </code> obviously only changes the id and <code> class_submit </code> does not seem to exist. I have read through both Otto's and Beau's writeups but to no avail.
If you check out the source of the function <code> comment_form() </code> , you'll see it doesn't even print a class on the input; <code> &lt;input name="submit" type="submit" id="&lt;?php echo esc_attr( $args['id_submit'] ); ?&gt;" value="&lt;?php echo esc_attr( $args['label_submit'] ); ?&gt;" /&gt; </code> I'm guessi...
How to add a class to the comment submit button?
wordpress
I know that WP 3.1 has added support for archives for custom post types but is there any way to customize the permalinks for them?
Take an example custom post type called <code> movie </code> the code below will create custom permalinks <code> awesomemovies/ </code> regardless of the one created by using the has_archive and rewrite options of register_post_type. <code> add_filter( 'rewrite_rules_array', 'custom_permalink_for_my_cpt' ); function cu...
Custom Permalinks for Custom post Type Archives?
wordpress
I have a home.php file which I am using as my home page and it is showing a specific page. In my index.php I have my main timeline. But when I access this page I get redirected to home.php. How can I do that? To show my main timeline in a differente path then home. Something like mysite.com/blog
Rename your <code> home.php </code> template file as <code> front-page.php </code> . In WordPress parlance, "home" is the Blog Posts Index . The front page of the site is Front Page . Likewise, the <code> home.php </code> template file corresponds to the Blog Posts Index and the <code> front-page.php </code> template f...
Main timeline in a different path
wordpress
I have installed wordpress on one membership site and found that whenever editor writes post on wordpress and attempts to post it, deletes the half of post randomly. I don't know what could be the problem. I have already did my search within community forums here and here . These two threads explain the same problem th...
The issue is related with the server permissions. I asked my hosts support to fix this. I found that they somehow fixed the issue. Also i noticed that stackexchange-url ("ciprian's answer") helped some of my friends but i was unable to solve issue that way.
Wordpress Post Deletion Issue
wordpress
I would like to learn how to create a plugin from scratch, there are tons of tutorials out there on the internet, but they are either premium or not a reliable resource. would like to know which are the best resources available on the internet.
A very first advice from me will be: Don't follow the tutorials on the tutorial sites blindly they are full of bad coding practices. Some of the resources that I follow: Mark on Wordpress Justin Tad Lock (You can also buy the copy of his e-book Professional Wordpress Plugin Development) Otto on Wordpress scribu's devel...
WordPress Plugin Development from Scratch. How?
wordpress
I created an additional site on my multisite subdomain installation. Now when I try to visit the new site or its wp-admin, I get a 404 error. My wordpress instance is hosted on AWS Checked the following AllowOverride is set to All in httpd.conf contents of .htaccess are the same as those in Network settings added the n...
You need to set a wildcard serveralias in that site's virtualhost declaration. Right under where it says <code> ServerName example.com </code> you should add another line like this: <code> ServerAlias *.example.com </code> You might have already done that, but it was the only thing missing from the list of things you h...
Multisite - getting a 404 for additional site created using subdomain install
wordpress
I would like to hack the default Recent Comments widget to show also the avatar of commenter. The modification should be really easy, if I change directly the code in <code> default-widgets.php </code> <code> if ( $comments ) { foreach ( (array) $comments as $comment) { $output .= '&lt;li class="recentcomments"&gt;' . ...
Sounds like you just need to make another widget of your own in a plugin. So copy the complete code from the default widgets file, and change the class name, then just edit the code you'd like to edit. <code> class YOUR NEW WIDGET NAME extends WP_Widget { // ... foreach ( (array) $comments as $comment) { $output .= '&l...
How to hack recent comments default widget?
wordpress
I'm creating a custom post form that is supposed to take an external image and uploads it to the media library and attach it to that post. This should be possible by using media_sideload_image, but I'm getting a blank page instead of working correctly, no error either. My code: <code> // Add the content of the form to ...
Firstly, reverse the order in your conditional. You should use <code> if ( false == $stop ) { ... </code> It's called a "Yoda conditional" and is on the list of best practices for WP code. Secondly, <code> media_sideload_image </code> won't return a WP error object if things fail. If things fail, it will return the ID ...
media_sideload_image generates blank?
wordpress
I'm trying to create a custom form which takes an image (offsite) and attaches it to the post so I can use it as a thumbnail in the loop. I've been looking at media_handle_upload but that appears to only be working for content that's locally uploaded. Ideas? Thanks, Dennis
When you link to an external image, WordPress will reference the external URL. <code> media_handle_upload </code> is meant to handle uploaded images that are now living on your server. So unless you're telling the server to download the image from the external source and save it on your server, <code> media_handle_uplo...
Upload image through URL?
wordpress
A theme normally posts to wp-comments-post.php when someone leaves a comment. When successful, it does a redirect to the page again but tacks on "#comment-" into the URL. What I was wanting to do was leave a message, "Your comment awaits moderation, which takes about 24 hours." Sure, I can intercept location.href and s...
The easiest and most straight-forward way is to put appropriate code in your <code> wp_list_comments() </code> callback, that outputs a message if a comment is awaiting moderation. The usual code looks something like this: <code> &lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt; &lt;em&gt;&lt;?php _e('Your com...
How To Detect Posted Comment in Theme Development?
wordpress
Done some reasonable searching for this and don't think it's been asked before. I've got a site which I'm developing a custom template/theme for. The site will use a page as the front page (rather than the list of posts), but I want to create a link in the template to the page of blog posts. There are some functions fo...
<code> &lt;?php $blog_link = get_page_link( get_option( 'page_for_posts' ) ); ?&gt; </code>
Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a "static" front page
wordpress
When registering a new taxonomy, the second argument of <code> register_taxonomy($taxonomy, $object_type, $args) </code> is the post type (or types) that this taxonomy is registered for. However, when registering a custom post type, you can also pass taxonomy as one of the arguments: taxonomies (array) (optional) An ar...
So I dug into the source and discovered that even though the documentation STATES that <code> $object_type </code> is "required", there's nothing in the logic that makes this so. <code> $object_type </code> is just added to the properties of the tax object, which presumably is also done when you register the tax while ...
Is $object_type truly required with register_taxonomy()?
wordpress
i have a bit odd question but here it goes: Due to page styling issues with the copyright logo, i deleted the whole div that says: "Powered by Wordpress (logo)". Now due to my SEO plugin, the source doesn't include the meta-generator tag. Now am i in violation of the Wordpress License, or im ok (although i do look irre...
There is no requirement to retain the "Powered by WordPress" note in the footer or the WordPress reference in the <code> &lt;meta&gt; </code> tags in your header. There is nothing in the WordPress license (GPL) that requires these remain intact. To take things a bit further ... the "Powered by WordPress" tag in the foo...
Wordpress Copyright Dillema (i.e. Powered by)
wordpress
I get a "update available" notification for my custom plugin "breadcrumbs trail nav" (not hosted in the official repo). Point is that there's a) no update available and b) it wants to get updated to version whatever from the yoast-breadcrumb plugin. Case: local install. My plugin header comment: <code> /* Plugin Name: ...
The updater works based on the plugin's installation path and the name of the file containing the header. I'm guessing both plugins are housed in a <code> /breadcrumbs </code> folder (since that seems to be Yoast's setup. Though Yoast's plugin uses <code> yoast-breadcrumbs.php </code> for its main file. I'm assuming yo...
plugin wants to update to wrong plugin
wordpress
I have purchased the DynamiX theme, and I'm trying to use it for the first time. I was looking at the widgets, and I saw some neat customized (Dynamic maybe?) widgets in the Inactive Widgets section. I was going to drag one to my Sidebar, but accidentally dropped it, and now it is gone. Is there any way to retrieve tho...
Inactive widgets are just normal widgets from the "Available widgets" list, which have been put in the "Inactive" section in order to keep the data they contained. What probably happened is that you dropped one of them over the "Available widgets" space and it dissapeared. But don't worry that doesn't mean that the wid...
What happened to my Inactive Widgets?
wordpress
I have a table in my database containing vote a tally I'm trying to order posts by. screenshot: the table I've tried something like this, which brings up all the voted posts and pagination okay but does not order them by DESC. Any advice if I'm approaching this right is appreciated. <code> &lt;?php global $wpdb; $my_po...
The Problem <code> $my_posts </code> doesn't contain any posts. It contains post IDs and likes. And you're dropping both into <code> post__in </code> , which can't work. I guess even the number of posts wouldn't work if the plugin(?) wouldn't add any post with a 0-x integer to the db-table per default. The Debug Try th...
How do I order my loop query?
wordpress
http://bigpicturepartnering.com I can log into the site. When I try to access the WP console I get the following error: PHP Fatal error: Call to undefined function is_site_admin() in D:\websites\bigpicturepartnering\wp-content\plugins\wordpress-related-posts\related-posts.php on line 81 How can I get into the console t...
Using the FTP client of your choice, go to <code> wp-content\plugins\ </code> , and delete (or move) the <code> wordpress-related-posts </code> directory. By the way: what version of WordPress are you using? And is this a local install or a live site?
Cannot Access Console
wordpress
I'm in the process of developing a plugin, and I'd like to figure out which versions of WordPress to support. But to get a good idea I'd need to know what percentages of old Wordpress versions make up the install base. Does such information exist? Alternatively if such information doesn't exist, does anyone have a sugg...
There's a page in the Codex that shows exactly that: WordPress > About &raquo; Statistics But really, it all depends on what features you're using. A safe bet for a new plugin would be to support WordPress 3.1.X and above (since that's the current stable release). You're setting yourself up for a lot of hurt if you try...
What are WordPress installation percentages by version?
wordpress
I'm developing a group blog on wordpress (first time working with it) and the client has requested that a 'None' option be added where an item can be posted without a "by" attribution. So basically there would be one article / excerpt template for attributed author's posts and another for the none option where the byli...
This is entirely possible. Though, I would recommend using the Post custom metadata (i.e. custom fields, or better yet, a custom metabox). I would use a custom metabox, with two radio select options: <code> Byline: (*) Author ( ) None </code> Then, in your template file, you can output the author byline only if the app...
Creating an option for writing a post without an author attribution for a group blog on Wordpress
wordpress
I have created a custom taxonomy as described on the Codex . I have "public" set to true, which show_in_nav_menus is supposed to inherit from, and have also explicitly added the show_in_nav_menus variable and set it to true. However, it only shows up for the user with the username "Admin". None of the other users can s...
Make sure you click "Screen Options" and check the checkbox for each menu you want to be able to select. For each user. -_-
Post Type only showing for "Admin" under "Appearance" > "Menus"
wordpress
i got a wp site with the WPML plugin and the CFT plugin. I set up custom fields for posts and what i'm trying to do is to keep the content of an <code> input type file </code> from the original post to its translation. That would save time as the pictures are the same between both posts and also save disk space on the ...
The latest version of WPML (version 2.3) has a new module for Media and this module takes care of the previous images issue. Now there is no longer the need to upload the same image twice. Just like copying the content from the original language, it is now also possible to duplicate the images and/or the featured image...
WPML & CFT: keeping custom field file to translation
wordpress
A WordPress site I'm doing a redesign for has around 1.400 posts by approximately 30 different authors. Unfortunately the authors of the posts have so far been entered as a custom field within the post, and not as separate authors in WP. I'd like to transfer this to the 'proper way', where each post has an author attac...
Not knowing your specific setup makes this pretty tricky ... but here are some ideas for alternatives that might save you time: Leave it as-is If these authors aren't actually users of the site to begin with, don't change anything. Non-users shouldn't be turned into users just for the sake of making search easier. Crea...
Transferring author information from a custom field to a proper author
wordpress
i've installed a LAMP server on my ubunutu 11.04. i've installed wordpress and hooked it right with the MySQL db. i've changed the permissions of the www-data group to read and write files. every thing is seems to work and i can manage the site through the admin panel, but i can't install plugins cause the system is as...
I usually do this when that happens : <code> chown -R nobody:nobody /path/to/wordpress </code>
wordpress on localhost lamp doesn't let me install plugins
wordpress
I'm developing a group blog on wordpress (first time working with it) and the client has requested that a 'None' option be added where an item can be posted without a "by" attribution. So basically there would be one article / excerpt template for attributed author's posts and another for the none option where the byli...
It's possible to do, but would take hacking up the theme. One convention I've seen is to create a user with a generic name, like Guest, or the name of your site. If you would still like to hack away. Then put a condition around the line\s in the template that displays the author like so: <code> &lt;?php if (get_the_aut...
Creating an option for writing a post without an author attribution for a group blog on Wordpress
wordpress
Let me explain. I have a link <code> www.mydomain.com/%artist-name%/%song-title%/ </code> . <code> artist-name </code> is a custom post type. <code> song-title </code> is the title of the post. Now, <code> www.mydomain.com/%artist-name%/%song-title%/ </code> displays the song entry -which is working great. The problem ...
You can create specific <code> single.php </code> for your custom post types, in the form <code> single-customposttype.php </code> (it's the same with <code> archive.php </code> , see Template Hierarchy ) for example <code> single-artist-name.php </code> . Then in those templates you can do pretty much whatever you wan...
custom post type problem
wordpress