question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
What is the right way to put in Open Graph Protocol into a wp theme in order to when someone likes or shares on facebook to show hihm as thumbnail the featured image of the post or the page? Which is the metadata that need to be written in the header.php or function.php?
This information doesn't have to be static. Here's an example: <code> &lt;meta property="og:title" content="&lt;?php if ( is_single() ) { wp_title(); } else { bloginfo('name'); } ?&gt;" /&gt; &lt;meta property="og:type" content="blog" /&gt; &lt;meta property="og:url" content="&lt;?php echo get_permalink() ?&gt;" /&gt; ...
Integrate open graph protocol without plugin?
wordpress
At the moment I am creating a page with Wordpress. Now there is some content, that won't chance often, that's why I want to use a page for it. I also want to create a custom template for that page. You see, nothing special. On that page, I want a 3-column layout, meaning 3 different blocks of text positioned with norma...
I suggest using the Advanced Custom Fields plugin for this. You can use it to add other entry fields to a post type (in this case, you'd probably want to add it to the Page type). In your case, you would probably want two other Wysiwyg Editor fields so you can write with formatting. The trick will be that, if you assig...
Creating a 3-column layout on a Wordpress Page
wordpress
I know that there are several e-commerce plugins, like JigoShop, WP E Commerce, and Woo Commerce. I also know there area lot of payment gateways like authorize.net and Paypal. However, if I have a really simple piece of software that I want to sell on my website, a single file download, what is the easiest and cheapest...
Go for Woocommerce! In my opinion the best and most powerful free ecommerce plugin. They offer also features for download products
What is the easiest and cheapest way to sell a download on my website?
wordpress
I'm trying to display a table format of the top authors listed by the most recent posts. It should display the author, its avatar, the date, and the title of the post (with a link). I have it listing the top authors along with the avatar. But it won't display the title of the post or the correct date. Here's what I hav...
Update: To get around this, I changed it up. It's probably not an ideal fix but it gave me what I needed. <code> // Selects from tables wp_users and wp_posts, selecting published posts and ordering by its post_date, limited to 10 $querystr = "SELECT * from wp_users, wp_posts WHERE wp_users.ID = wp_posts.post_author AND...
Lists Top Authors by Most Recent Posts
wordpress
Does anyone know about any ecommerce plugin with a feature to send the purchase to a friend? I need that feature but I cannot find any around. I would appreciate any information on this.
I found one plugin called Certificate gift, basically does the job
ecommerce plugin with "buy for a friend" feature
wordpress
I'm using following snippet to output pagination: <code> // get the current page if ( get_query_var('paged') ) { $current_page = get_query_var('paged'); } else if ( get_query_var('page') ) { $current_page = get_query_var('page'); } else { $current_page = 1; } // structure of “format” depends on whether we’re using pret...
I think that's because the code is doing strictly what you're telling it to do, here: <code> $format = empty( $permalink_structure ) ? '&amp;page=%#%' : 'page/%#%/'; </code> Note: <code> '&amp;page=%#%' </code> . Try building your permalink structure using <code> add_query_arg() </code> , which handles proper appending...
Frontpage pagination issue with paginate_links() function
wordpress
I have a custom query in category-slug.php, which works fine unless the category doesn't have that number of pages itself. If the category only has 5 pages of posts, but the query I put in has 7, it'll show 404 for pages 6 and 7. Pretty sure the reason for this is that category-slug.php checks to see if there is a page...
I've not tested this, but adding an action after <code> parse_query </code> or <code> wp </code> which checks if the current request <code> is_category() </code> , and then setting the is_404 property of the global <code> $wp_query </code> to false might set you off in the right direction.
Force category-slug.php to show page, even if it doesn't exist
wordpress
When I search on my site it currently doesn't search the content in my custom meta boxes. How can I include this content when searching? I'm registering my meta boxes as follows: <code> $meta_box['recipe'] = array( 'id' =&gt; 'recipe-meta-details', 'title' =&gt; 'Recipe Meta Details', 'context' =&gt; 'normal', 'priorit...
try the Relevanssi plugin.
How can I include meta box content when searching?
wordpress
I want to have a set of ~3 pages in a subdirectory called "about" <code> example.com/about/history example.com/about/program example.com/about/coaches </code> I don't want any <code> about/index.html </code> page, I just want "about" to be the label of the drop-down menu. The pages will be just regular WordPress pages....
Use the wordpress Menus under Appereance -> Menu and wp_nav_menu instead of wp_list_pages in your theme. If your theme is recent, changes are that you are using it now. Under Appereance -> Menu Create a menu, label il "Site menu" Create a custom link About, and assign it # as destination link Drag and drop your about p...
How can I set the first link in my nav menu to simply be a drop-down to some other pages
wordpress
I'm looking for a plugin recommendation. I'm currently using bbPress to add a forums area to our website. However, it has been deemed "disappointing" in terms of functionality. Are there any forum plugins which have the following features? Easy image attachment (i.e. not like the bbPress GD add-on which uses the Media ...
SimplePress currently is the best-featured forum plugin for WordPress.
Fully-featured forum plugin
wordpress
I'm trying to get the link to the thumbnail size of an attachment image. I tried this: <code> wp_get_attachment_link( $img_id, 'thumbnail' ); </code> but it returns the actual HTML for the image wrapped in a link. I want just the bare URL directly to that size image. Does Wordpress have a different function I should be...
What about using <code> wp_get_attachment_image_src </code> ? Using <code> wp_get_attachment_image_src </code> : <code> $src = wp_get_attachment_image_src( $img_id, 'thumbnail' ); $src = $src[0]; // Grabs only the URL ($src[1] = width of image, $src[2] = height of image) </code>
Get the bare URL for an attachment
wordpress
I have files in my theme called <code> single-audio.php </code> and <code> single video.php </code> , but when I click on an audio post-format or video post-format wordpress uses the <code> index.php </code> instead of my <code> single-audio.php </code> or <code> single-video.php </code> files. Any ideas?
There is a huge difference between Post Formats and Post Types. I am assuming you are using post formats, which do not have a default template file for you to use. What you can do though is use <code> has_post_format() </code> to see if the post has the format you are using, and if it does, use <code> get_template_part...
Post formats "audio" and "video" only showing in index.php
wordpress
I need the ability to add an image to a page, like a featured image. How can I do that, and how do I get the featured image to display in page.php? It can be a plugin if what I am asking can't be done within Wordpress itself out of the box.
Eek! A 33% acceptance rate isn't really going to do you any favours but lucky for you Wordpress' in-built post-thumbnail featured image functionality works for posts, custom post types and pages too. Add the following line into your theme functions.php file: <code> add_theme_support( 'post-thumbnails', array( 'post', '...
How can I add a featured image to a page?
wordpress
When I'm writing a fix to some bugs, I often increment the version and send it to the bug finder to see if my fix works. If I have <code> 1.2.5 </code> and I want to create a beta that will become redundant once I commit my code, should I use <code> 1.2.5-beta </code> or <code> 1.2.6-beta </code> ? My concern is that <...
If your current plugin version is <code> 1.2.5 </code> , and you have a beta version for the next version, it should be called <code> 1.2.6-beta </code> . Your user can install it, and when the real <code> 1.2.6 </code> version is released on the repository, WordPress will notify the user on the Plugins page and let hi...
Beta Versioning of Plugins
wordpress
I have some issues when I try to move it on other server. This are the steps: I go into my actual database through phpmyadmin, export the database. I copy the entire folder of my wordpress website from FTP, and paste it through FTP on my new host. I modify the wp-config.php with my new database details. Now I enter on ...
Error establishing a database connection means a bad password, DB user, DB name or server location (usually localhost) in wp-config.php. Simple as that. Check and check again. Editing wp-config.php « WordPress Codex
Moving to another server database connection error
wordpress
I'm creating a plugin that will allow users to create custom post types on the fly. On the new post types, I want a custom Button to show In the TinyMCE. Each of the post types has a unique description, so I want to add the buttons based on the post type description. Something like: <code> if ($post_type-&gt;descriptio...
This is used in one of my plugins and working well, hopefully it can draw some inspiration: <code> public function efpd_run_tinymce(){ global $typenow, $pagenow; if ( empty( $typenow ) &amp;&amp; !empty( $_GET['post'] ) ) { $post = get_post( $_GET['post'] ); $typenow = $post-&gt;post_type; } $curpage = $pagenow . 'post...
TinyMCE Buttons on Certain Post Type
wordpress
I am looking for some plugins that would automatically post information about new blog entries (posts) to my facebook/google+ pages. But - simple search through plugins listing shows that such plugins don't exists, or are rare. Most of the plugins offer content sharing the other way (i.e. display entries from facebook/...
For Facebook: http://wordpress.org/extend/plugins/simple-facebook-connect/ For Twitter: http://wordpress.org/extend/plugins/simple-twitter-connect/ For Google+ http://wordpress.org/extend/plugins/simple-google-connect/ The twitter and facebook plugins will autopost from your site to each service. The G+ plugin is new, ...
Simple plugins to post info about new blog entries?
wordpress
A few basic questions to accelerate my wordpress plugin development start. I'd like to develop a wordpress plugin that adds some javascript and css to a specific page. What filters or actions should be used? How to restrict execution of a plugin to a single (known) page? How can a plugin add some content to a page?
WordPress has a built-in function called wp_enqueue_script() which will allow a certain piece of JavaScript to be included in a page. If you'd just like to see that script on a particular page, you can conditionally call it from the theme file. For example: <code> &lt;?php if (is_page('home')) { wp_register_script('cus...
How to execute a plugin on a single page only?
wordpress
For example, I have post named "My book number 1", that is in "Book" custom post type group. And is another post named "My book number 2", that is too in "Book" custom post type. Question: How I can set specific design template for "My book number 1" post?
You can just create a template...call it something like book-one-template.php, the first line after <code> &lt;?php </code> will need to be <code> /* Template Name: Book One Template */ </code> . Then, using that and the custom-post-template plugin you can set that as the template for any post you like.
How set template for "custom post type" individual post
wordpress
Currently I have a root wordpress installation at www.mysite.com. I've added a new folder /store in the root and added in a blank html. However, I can't seem to access the folder by going to www.mysite.com/store. Any idea how I can do this? * Update * I realised when I'd encountered this issue there was no .htaccess fi...
I don't know why you couldn't access the folder. Maybe you wanna check your <code> .htaccess </code> file first. The default rewrite conditions for apache created by WordPress should include the following two lines, which prevents the redirecting to <code> index.php </code> if a physical file or directory is found. <co...
Creating a sub folder inside a root installation?
wordpress
Is there a simple way do prevent all caching when testing the appearance of changes to the site? I use WP Super Cache. I can delete its cache using the option provided, delete the cache for my browser, and still some changes to css or widgets do not refresh. I try other work-arounds like switching browsers or computers...
Add the <code> filemtime() </code> of your stylesheet as a parameter: <code> &lt;link rel=stylesheet href="&lt;?php echo get_stylesheet_uri() . '?t=' . filemtime( get_stylesheet_directory() . '/style.css' ); ?&gt;"&gt; </code> Result: <code> &lt;link rel=stylesheet href="http://example.com/themes/your-theme/style.css?t...
How do you avoid caching during development?
wordpress
What's the best way to achieve this: I have local videos on my server, but if I use the WP add media button I just get a link to a video, rather than it embedded. Are there any good plugins which will let me embed local video? Everything seems to support video sharing from Google, YouTube, Vimeo etc.
You can try this: Use JWPlayer or Flowplayer or whichever videoplayer you like. You can also use http://videojs.com/ which will give you the ability to automatically change from html5 to flash player and it's free and even hosted by them. Now, from their own example: <code> &lt;video id="my_video_1" class="video-js vjs...
Plugin to embed local video into Wordpress?
wordpress
Which are the ways and how is possible a wp site become an iphone, ipad, android and a blackberry application(not a wp mobile theme)?
WordPress is a set of PHP scripts running on a web server. So your application needs a web server, a data base and PHP. I don’t think this is possible on all of those platforms.
How can I make a wp site in a mobile application?
wordpress
I have some problem making my contact form work. The contact form should only be in one simple site. So i created two templates. The first template only has the form. The other one have the php code to send a mail. But i cant make the form contact the other template Here is the first template <code> &lt;?php /* Templat...
One way to accomplish this is to setup two pages, with two page templates , one with your form code and the other with your mail code. The form action would point to the permalink of the page whose template hosts the mail code. That said, I'd actually recommend using a plugin like Contact Form 7 instead. It's highly mo...
Trying do build a contact form
wordpress
I'm currently setting up comments for a Wordpress theme I'm created, I have just successfully created nested comments but I'm having issues removing the word ' reply ' from the reply button in order to use an image via the css. The code I'm using at the moment for the reply link is as follows: <code> &lt;?php comment_r...
try: <code> &lt;?php comment_reply_link(array_merge($args, array('depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth'], 'reply_text' =&gt; ''))) ?&gt; </code>
Wordpress comment reply link image
wordpress
So this is driving me absolutely insane. I've spend days trying to fix this and I can't work out why this is so difficult as surely this is a very common permalink structure! I looked through hundreds of answers and posts and none of them seem to solve the problem. I simply want this structure: <code> mysite.com/custom...
Follow the advice on stackexchange-url ("this question") as you did already, but add this to your code: <code> add_action( 'generate_rewrite_rules', 'fix_literature_category_pagination' ); function fix_literature_category_pagination( $wp_rewrite ) { unset($wp_rewrite-&gt;rules['literature/([^/]+)/page/?([0-9]{1,})/?$']...
Shouldn't this be easy?! Custom post type/custom taxonomy permalink
wordpress
I'm writing a theme which has it's own set of database tables. I'm wondering what is the best action for me to use when I want my install function to be invoked only once when the theme is activated for the first time? I know there is a <code> setup_theme </code> action, but not sure if that's the one I should use.
You should read this: Activation/Deactivation hook for wordpress theme
What's the best action to use when you want to do something only once per theme setup?
wordpress
Thumbnail images are not displaying by blog excerpts on my blog at http://richardclunan.com/blog/ -- I found some code that I think I might need to add to functions.php to make this happen, and if I do need to do this, I'd like to know where in functions.php I should add the code... In my twentyeleven files, in functio...
Post thumbnails are enabled in the twenty-eleven theme by default. If it's not working either you have a plugin conflict, or someone has edited the functions.php file. Here is the section of the twenty-eleven functions.php file that should enable the post thumbnails: <code> add_theme_support( 'post-thumbnails' ); </cod...
Where in functions.php to add this code so thumbnail images display?
wordpress
How do auto populate the excerpt field with the first 15 words of the post content? I found this snippet: <code> function wps_excerpt_content( $content ) { $content = "YOUR EXCERPT HERE"; return $content; } add_filter( 'default_excerpt', 'wps_excerpt_content' ); </code> But I don't know how to modify it with what I nee...
How about using the <code> excerpt_length </code> filter? <code> function my_excerpt_lenght( $length ) { return 15; } add_filter( 'excerpt_length', 'my_excerpt_lenght', 999 ); </code>
Auto Populate Excerpt Field
wordpress
I think i've almost got my head around this ajax is Wordpress business, thoroughly ejoying learning it but i'm now totally stumped. First up is the nasty bits! I have these in my main plugin file: <code> wp_enqueue_script( 'function', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery', 'json2' ) ); wp_localize...
Look at the top of your generated HTML source code. Are you seeing something like this: <code> &lt;script type='text/javascript'&gt; /* &lt;![CDATA[ */ var MyAjax = {"ajaxurl":"http:\/\/localboast\/home\/wp2\/wp-admin\/admin-ajax.php"}; /* ]]&gt; */ &lt;/script&gt; </code> wp_localize_script now escapes whatever you pa...
Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
wordpress
After a major site review, we've created a new link and category structure to better accommodate URLs and content for the long-term. While we roll out the change, we need to avoid broken links and SEO issues because our category structure is changing. While best practice is to implement a 301 redirect, is there a solut...
For a large number of redirects, using your .htaccess file is the way to go (assuming you're using apache). If you aren't doing an unreasonable number of redirects and want control within WordPress' Admin, the aptly named Simple 301 Redirects is a great option.
Solution for Wordpress URL structure changes and 301 redirects?
wordpress
I'm using the plugin Multiple Content Blocks, which creates separate windows for content so that you can have, say, a 2-column template for a page; one column is editable in the standard TinyMCE window and below it is a second TinyMCE window where you can add/edit the content for the second column. What's nice is that ...
How about defining a custom page template? If you put <code> /* Template Name: Two Column */ </code> as the first line of your PHP and put the template with the other templates (page.php, home.php, index.php, etc) in your theme, then on the page creation screen there will be an option to select template which you can u...
Help me edit a variable with php
wordpress
I need a second set of eyes. I am unsure why this code is not saving properly. Basically I hit save and my field values disappear. I have two other post-types saving fine using this structure. I feel I've just been looking at a screen too long and am missing something. :) Any suggestions? Thanks! Nadine <code> &lt;?php...
<code> $article_date = $custom["tf_book_author"][0]; $article_date = $custom["tf_book_afirst"][0]; $article_date = $custom["tf_book_isbn"][0]; $article_date = $custom["tf_book_dts"][0]; $article_date = $custom["tf_book_price"][0]; </code> This is your issue. You need to set these to <code> $tf_book_author </code> and s...
Problem Saving Custom Post Type Meta Values
wordpress
I'm trying to use the script below in order to disable automatic thumbnail generation when images are uploaded via the media manager. I'd like to leave the thumbnail option intact when an image is uploaded directly to a post, because that uploader gives the user the ability to specify the image size. The problem is tha...
Not sure if I've understand this correctly but you should be able to check which tab is currently open by looking at <code> $_GET['tab'] </code> upload new tab = <code> type </code> from url = <code> type_url </code> gallery = <code> gallery </code> media library = <code> library </code> So you could wrap your code ins...
How to disable image thumbnails from media manager but not post media uploader?
wordpress
One of the most time consuming things for me in blogging with Wordpress is adding images to the blog post. For each image, the user needs to click first "Add Media" button. Then, the user waits for the appearance of the "Add Media Dialog". Then he clicks "Media Library" tab in the dialog to see all the images he previo...
Nothing here is a silver bullet, but here are some suggestions: If you find yourself using your library more than uploading new images, you can make the default tab "Library": <code> add_filter('_upload_iframe_src', 'change_default_media_tab'); function change_default_media_tab($uri) { return $uri.'&amp;amp;tab=library...
Faster way to put images into a blog post by using Add Media dialog
wordpress
So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is that it outputs the whole homepage in the #results div rather than just the results figure:
If your AJAX Url is conversion.php it will most likely point to yourdomain.com/conversion.php. Is your file in that location? Looks like not, and I guess you don't have a 404.php, and in that case your request gets directed to your index.php, that's why you get the contents of your homepage. If your file is in your the...
Using Ajax call in jQuery doesn't work in widget
wordpress
Within the Wordpress dashboard, the widget screen is locked and it won't allow me to drag new widgets within the sidebars - or remove any that's there. I've seen suggestions to toggle the 'screen options' from that page, but there that button is locked as well within that page in the dashboard. I've tried deactivated p...
sounds like something is breaking your javascript. Install/Open Firebug (if using firefox) and check the console for JavaScript errors then debug from there. It's probably a plugin loading some conflicting JS. The other thing I've seen do this is loading jQuery from Google CDN in the backend. So if your theme is using ...
Widget Screen Locked
wordpress
i run 3 wordpress sites. they are each on different installations. i don't really want to combine them right now because i'm not very proficient technically, with wordpress, but i might want to combine them at a later date, to make it easier to administer. but i want to check in case it's better to set it up now, becau...
at a later date, when i have 3 sites running, each with lots of content on, can i combine them at that time? Yes, you can. I've found the easiest way to do so is to use the Export/Import feature, but it really depends on the site, and sometimes you have to get creative. Assuming these will be easy, what you would do is...
possible to combine sites that have lots of content, into multisite?
wordpress
Hi all I've created a function that basically allows the user to input the embed code for youtube into a custom field called youtube and this will then be styled on a wordpress post. Now I can get it to work perfectly until I want to wrap some CSS around it. Could you have a look where I'm going wrong. I think it's bec...
Your function is going to hit the end of that first return and stop. Concatenate the strings and it should start working.
Calling Custom Field within Function wrapped with Divs.
wordpress
I'm working on plugin that creates and stores some data in database table (using global $wpdb-> base_prefix). In WordPress multisite I want sub-website owners to have access only to data that they've created. What is the best way to handle this? Should I create new table for each sub-website, or add "blog_id" column to...
use the API, the functions of WordPress for save data and check before, it is an Multisite install; thats all. The first example is only for check, is the activated as network wide. <code> // if is active in network of multisite if ( is_multisite() &amp;&amp; isset($_GET['networkwide']) &amp;&amp; 1 == $_GET['networkwi...
Managing database tables in WordPress multisite
wordpress
I'm using a plugin. It has an action like this. <code> add_action('publish_post', 'old_action'); function old_action($pid) { "code goes here" } } </code> I'm writing a module for this plugin. So i need to override that old action function with my new action function. This is my new function. <code> function new_action(...
You can use the <code> remove_action() </code> function, like this: <code> remove_action('publish_post', 'old_action'); add_action('publish_post', 'new_action'); </code> It's important to note that if the old_action was added with a priority parameter, you must add that to the <code> remove_action </code> call, otherwi...
How to override existing plugin action with new action
wordpress
I am helping out a non profit and they wanted some help in modifying the home page of their site .I looked around the admin area but I couldnt not find the index page anywhere so that I could make the changes. Where should I be looking and if I cant find it from the admin page ,what other ways can I go about finding it...
Take a look at WordPress' Template Hierachy . You will need to find which theme is active, and investigate the theme files. Also check Settings &rarr; Reading to see if a static page is being set as the homepage. If it is not it should be one of the following template files: index.php home.php front-page.php Hope that ...
Finding the index page using the admin panel of wordpress
wordpress
I've created a taxonomy (let's call it <code> tax </code> ). I need to limit what a user can see. The users can't edit anything, just read the blog. If it was just setting what they could see once, I'd probably just create a new user role, but what they will be viewing will change frequently. So for an example: <code> ...
How about something like <code> if( in_array( $current_tax, get_user_meta( $user, 'legal_taxonomies', true ) ) ) </code> You can get the current taxonomy information using <code> get_term_by() </code> . This operates on the assumption that you're storing the available taxonomies as an array, but is easily changed for a...
Prevent certain subscribers from seeing specific taxonomies (changes frequently)
wordpress
In my buddypress I have set the register page as homepage. Now whenever a logged-in user tries to access the register page(homepage), they are redirected to Members directory. I want it to change to, home page. is there any way? I have tried changing the buddypress/bp-members/bp-members-signup.php file this way: <code>...
Just a heads-up that you should be using the <code> bp_loggedin_register_page_redirect_to </code> filter to accomplish this, rather than modifying BuddyPress files (which will get overwritten on every upgrade). <code> function bbg_bp_loggedin_register_page_redirect_to( $redirect_to ) { if ( bp_is_component_front_page( ...
Buddypress register.php user redirect
wordpress
Is it possible to make the heading on a page different text to the text of the menu item? I have a page with a very long title and I'd like to make the clickable menu text shorter. Site is here: http://richardclunan.com
Go into Apparences -> Menu -> (find the header menu) -> Click the page you want to change, when the options open, just change the heading label to whatever you want. Regards
Is it possible to make the heading on a page different text to the text of the menu item?
wordpress
I'm building a search results template and want to display the parent section of the website for each result returned. so at the bottom of each search result excerpt it'd say "Found in [section] | Reacd More" Something like: http://www.foxglovecovert.org.uk/search/results/search&amp;keywords=local/
For your custom post types and your blog, you can use get_post_type() . For your About parent page, if the pages only go one level deep, you can check <code> $post-&gt;post_parent </code> to see if it's the about page. Otherwise, you can use get_post_ancestors() and check that array to see if your About page is in it!
Listing parent section in search results
wordpress
I want to customize the editor role so that they only have access to 'pages, posts, comments, profiles'.
I've tried quite a few different ones, I always come back to the one that works best: Justin Tadlock's Members Plugin. It's very easy to use right out of the box. It has predefined roles, or you can create your own user roles with about every option available in WordPress.
Which plugin will let me decide what users have access to on their side bar in wp-admin?
wordpress
I use this script to display recent posts: <code> &lt;ul&gt; &lt;?php query_posts('showposts=5'); ?&gt; &lt;?php while (have_posts()) : the_post(); ?&gt; &lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;?php the_content_limit(250); ?&gt;&lt;/li&gt; ...
Add this after your endwhile <code> &lt;?php wp_reset_query() ?&gt; </code> Regards
Recent posts script mess up blog posts
wordpress
How can I import/convert hits from the plugin top 10 to wordpress popular posts plugin?
Short Answer You don't. Long Answer These two plugins are fundamentally different. Popular Posts stores views in a custom field with each post. Top 10 creates a new table in the database and stores views there. So you'll need to look for the <code> wp_top-ten </code> table in your database. It should have these fields:...
How to convert hits from Top 10 plugin to WordPress Popular Posts?
wordpress
I have written a plugin which lets the user upload file attachments for using wordpress as a download site. So I have added a meta box which shows the user the files he has uploaded for every post. Every thing is working fine until I wanted to make it so that if a user uploads file using the built-in upload manager and...
When the thickbox gets closed it triggers 'tb_unload' (in earlier Wordpress version it was just 'unload' (not sure though) ) so you can do something like: <code> $(window).bind('tb_unload', function() { //do stuff }); </code>
How to hook into wordpress admin upload iframe?
wordpress
Here is what I am trying to do: I am trying to allow users to create a post under 'category-A'. Then Create a post under 'category-B' which is linked to the post under 'category-A' For example: category-A Post Title Post content... link to additional post under category-B
If you want to generate those connections automatically, based on a certain algorithm, then YARPP would probably do the job nicely. If you want control over each connection, then you might want to take a look at Posts 2 Posts .
Which plugin will let me relate one post to another?
wordpress
I am trying to customize my BuddyPress layout and I can't find where to edit the user profile page layout. EG: /members/username-nice/settings/ This is just the page where you can change your password. The header and footer appear as they should, and there's a form to change your password, but I can't find the template...
SOLVED .... The settings tab is rendered through the template <code> members/single/plugins.php </code>
Buddypress User Settings template location?
wordpress
How do I create a "publish" button to put in a custom metabox? Or if you can point me to the code that creates the current publish box, that'd help me out. -attempting to simplify my custom post type-
Dig in Core All admin UI pages use a core function for a reason: <code> submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ); </code> There's also <code> get_submit_button() </code> in case you want to return instead of print the button.
How can I move (or create another) publish button?
wordpress
If I add a page with the name 'Bottle Project' and give it the parent 'Other Projects', the page appears at http://richardclunan.com/other-projects/bottle-project -- so that looks right. ...but if I mouse over the menu item 'Other projects' at http://richardclunan.com , the item 'Bottle Project' doesn't appear. And if ...
If you go to appearance-> Menus, you should be able to fully customize your menu, assuming your theme is even decent.
Page not appearing under its Parent
wordpress
On post edit pages, when a slug exceeds a certain number of characters, Wordpress abridges it with an ellipsis ( <code> ... </code> ). For example, if my slug is <code> i-want-to-be-able-to-see-this-slug </code> , it appears on the edit page like this: Permalink: <code> http://example.com/2012/i-want-to-be-a...-see-thi...
There is a filter at the end of the function: <code> 'get_sample_permalink_html' </code> . Hook into this and just replace the shortened form with the full length. <code> &lt;?php # -*- coding: utf-8 -*- /* Plugin Name: T5 Unabridge Permalink Slug */ add_filter( 'get_sample_permalink_html', 't5_unabridge_sample_permali...
Prevent Wordpress from abbreviating-long-slugs...-in-the-admin
wordpress
Any bright ideas on how to fallback to an HTML page "Website Offline" when the main box holding the Wordpress multi-site is down? Real scenario; fully operational SAAS built on cloud vps. Cloud VPS has issues, emergency rebuild of SAN, our box goes offline. Is there a way to direct traffic to a specific page in the eve...
If you are running Nginx, it is easier to implement a similar scenario with an isolated server running Nginx alone. In Nginx, the HttpUpstreamModule can be configured to divert the traffic to a completely different domain running on a different server. For example, if your site is yoursite.com, it is easy to divert the...
Divert traffic when site down
wordpress
This is my website. I installed many plugins but if a plugin have ajax, then it doesn't work in main page. can anybody help me?!?
Taking a look at your code, I noticed one huge issue (also pointed out by Milo). Your script tags (the ones that pull in jQuery and other scripts) are wrong. For example, this: <code> &lt;script data-djssrc="http://2barnamenevis.com/wp-content/themes/mediaflux2/js/jquery.min.js" type="text/djs"&gt;&lt;/script&gt; &lt;s...
Why none of the plugins that have ajax doesn't work in my website?
wordpress
I'm coding a graphic menu that consist in five divs with a background each. On mouseover the background changes and the child div disappears. On click, each one works like a link to the correspondent category. I want to apply some changes to the clicked div, so I was wonder if there is some function in wordpress to get...
If you use <code> wp_list_categories </code> (see Codex ), it automatically adds the classes <code> cat-item </code> , <code> cat-item-{ID} </code> and (to the current category being viewed) <code> current-cat </code> . (It also adds <code> current-cat-parent </code> to the parent of the current category). This should ...
Change div background acording to the selected category
wordpress
On the reference page for <code> wp_get_attachment_image_src </code> , there is a parameter called <code> icon </code> and it only says: <code> $icon - (bool) (optional) Use a media icon to represent the attachment. Default: false </code> What is this used for and how does it affect the returned value?
It's a icon with which to display the attachment. If it isn't set, it uses the default icon. The exception here is for images : the returned values always refer to the thumbnail (of size set in the arguments of <code> wp_get_attachment_image_src </code> ). Icons are always shown at their original size. If the attachmen...
What is the "icon" parameter in wp_get_attachment_image_src used for?
wordpress
I just updated to the latest Wordpress version and also updated Jetpack to the newest version. There's a new feature that let's users subscribe via e-mail so they'll get an instant notification if there's a new blog post. I always wanted a function like that, so I actived it. However, I only need the widget function: a...
However, I only need the widget function: a widget in the sidebar with a small form to subscribe via e-mail There is a widget to do. On your site's widgets configuration page, search for "Blog Subscriptions (Jetpack)" and drag it to an active sidebar.
Jetpack: Subscribe via e-mail
wordpress
I created an EC2 instance and installed WordPress inside <code> /var/www/html/blog/ </code> . I'm running Amazon Linux with Apache. Assuming I want to create another blog. Do I create another directory and install WP as per the first attempt? Or can I run two blogs from the same installation?
Unless EC2 is much different than other servers, you should be able to install another WordPress installation under another directory. For instance, you could have <code> /var/www/html/blog/ </code> with WordPress installed and <code> /var/www/html/blog/wordpress </code> with another WordPress install. You can either u...
How do I install more than one WordPress blog on EC2?
wordpress
I am using theme Twenty Eleven and am trying to add a vote up script in the content.php which only displays on a certain category.
you can do that in multiple ways .. For example you can do a conditional in the PHP itself with a wp built in function : <code> if ( in_category( 'my-category' ) { //Do something } </code> or for example, if the script is a javascript you could load the script in a conditional way , so it would not load where it is not...
How do I add a function on a specific post category?
wordpress
I'm using this front end post submission form that I took from stackexchange-url ("this") question: <code> &lt;?php $postTitle = $_POST['post_title']; $post = $_POST['post']; $submit = $_POST['submit']; $category = $_POST['cat']; if(isset($submit)){ global $user_ID; $new_post = array( 'post_title' =&gt; $postTitle, 'po...
From the Codex: Categories need to be passed as an array of integers that match the category IDs in the database. This is the case even where only one category is assigned to the post. Currently you giving it a string of the category ID. Try: <code> $category = array(intval($_POST['cat'])); </code>
Can't assign another category other than Uncategorized int he following front end post submission form?
wordpress
When I post a blog post, the blog post doesn't appear with a separate url -- it just appears under http://richardclunan.com/blog and there's no button to edit the url when I'm on the Edit Post page. How do i make blog posts have their own urls?
Set Permalinks (in settings) to /%postname%/, you set the blog location in settings-> general, not in your permalinks. Permalinks builds on the Settings-> General URL
How to make blog posts have their own urls?
wordpress
i have read that i have to weight with w3 total cache until my blog design is complete. But to be honest, it will never be finished. I'm constantly developing new stuff. How will this affect my site if i chose to use w3 total cache? Can i reset the cache every time i make changes to the theme? and how does this plug in...
You can turn it on and clear the cache whenever you like, it even adds a button to the admin bar specifically to purge all caches. I say implement it as early as possible so that you don't have to rewrite any code in case there's an odd conflict with it or anything. You can turn off comment caching if memory serves rig...
W3 total cach and theme changes
wordpress
Im looking for a way to make tags a searchable object. To clarify, Im NOT trying to make the search engine search posts by looking at its tags, but I want tags to show up in the results just like a post. any help would be much apreciated
You'd have to do some modification to the generated SQL query via filters: <code> posts_search </code> , <code> posts_join </code> , <code> posts_where </code> . Or you can just use the plugin Search Everything .
How to make tags show up in search results?
wordpress
I'm trying to come up with a solution that would allow me to remove the default post types (pages, posts, comments, links, etc) from all the multi-site blogs EXECEPT the primary blog. It will remain fully functional. My purpose is to apply a custom post type to all the multi-site blogs to replace the defaults. Any help...
I don't use Multisite much, but I believe something like this might work: If I'm not mistaken, <code> global $blog_id; </code> lets you access the various "Blogs" ids. Then, the "Main Blog" should have an ID of 1. So, removing the post type menus from all blogs that DO NOT have the id of 1 would go something like this:...
Remove default post types on all sites except primary blog. WPMU
wordpress
I recently added thumbnails for my categories, which has had the side effect of making the page they are listed on unbearably long. Because of that, I am hoping to paginate the list of categories. Here is what I am using to generate the list of categories and thumbnails (unstyled): <code> &lt;?php $args=array( 'orderby...
Untested, but this should at least be on the right track: <code> $posts_per_page = 50; $page = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $offset = ( $page - 1 ); $args = array( 'child_of' =&gt; 504, 'order_by' =&gt; 'name', ); $categories = get_categories( $args ); for( $i = $offset * $posts_per_page...
How do I paginate a list of categories?
wordpress
I have the following function to output a custom menu in select format for a responsive design I'm working on. It's working exactly how I want it to apart from I would need to exclude sub menu items. At the moment it includes all levels. Does anyone know how I can tell <code> wp_get_nav_menu_items </code> to only displ...
Think I worked it out!! I did a print_r on each $menu_item and saw there's an array key called menu_item_parent in there. So I changed this: <code> foreach ( (array) $menu_items as $key =&gt; $menu_item ) { $title = $menu_item-&gt;title; $url = $menu_item-&gt;url; $menu_output .= '&lt;option value="' . $url . '"&gt;' ....
wp_get_nav_menu_items how to exclude sub level menu items?
wordpress
I have strange situation...my permalinks not work after setup nginx to work with apache. permalinks work if they not finish with ".html", but work if finish with "/" ie.: this work: justflick.com/new-the-dark-knight-rises-set-photo-2012-01-25.html/tom-hardy-as-bane-in-the-dark-knight-rises but this don't: justflick.com...
It isn't working because Nginx tries to serve the permalink as a static file. At the moment the current configuration doesn't allow HTML files to be passed to Apache. Please remove the "html" part from the following block so that the permalinks are passed to Apache... <code> location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|m...
Custom permalinks not work on Nginx + Apache
wordpress
Often i build a site and we have test posts. I was wondering if there's a way via sql to drop all the blog posts with a simple sql query. Obviously, I would have backed up my previous database before truncating these tables. I would like to leave the pages alone if possible.
You're probably better off doing this with wordpress functions and adding a button which would delete all posts (or even having a shortcode that, when loaded, would do it). The reason I recommend doing this instead of SQL directly is that <code> wp_delete_post() </code> will take all the associated meta with it, which ...
Removing posts by sql
wordpress
I want to convert one HTML5/CSS3 theme in WP This theme is build for iPads, now my question is is that possible to convert it? If yes then how? I mean should i create each different page template (ex. dashboard, calender etc..) I just want to conform it before start that how should i need to understand before start it?
It definitely is possible, and you should really read the WordPress Codex before diving in, and read it in-depth. It's very well documented and usually a simple Google search will bring up answers for many of your questions. The WordPress Codex will explain everything for you, especially this page for your situation, r...
iPad WordPress theme?
wordpress
When I create a page whose title contains only digits - wordpress adds '-2' to the url, like it does in cases, where there is a page with the same name already existing. However this is not the case here. Example: If I create a page titled <code> 909303 </code> , the url will be: <code> ../909303-2/ </code> I want it t...
well.. it is not exactly the case, but in a way, it is . every page has actually "2" names , one is the name you give and one is the ID, which is the number. If you will give a "name" which is a "number" - it might override another entity (Can be a post, page , attachment, or even a draft) with the same ID. that would ...
How to prevent URL-modification when page title contains digits only?
wordpress
I want to create one extra table filed if it is multisite's main blog (While plugin activation). I mean like this <code> if (main blog) { execute this sql; } else { execute this sql } </code> PS: This is the code for "execute this sql". If child blog: <code> $sql = "CREATE TABLE tablename ( id bigint(20) NOT NULL AUTO_...
You can use is_main_site conditional tag like this: <code> if (is_main_site()) { execute this sql; } else { execute this sql } </code>
How to check main blog in a multisite using if statement?
wordpress
I have a Page on my site that I use as a Blog. And then there's another page that I'd like to add a few different posts to. It's not really a blog, it's a list of projects, and each one will have about 300 words of description. I'd like users to be able to pick which project they want to view. So this could work as eit...
It's absolutely possible on the same WordPress install. How I do it, is I generally reserve the 'posts' sections for the site's news, and make a Custom Post Type for other things, such as your projects list. Have a look at the codex for custom post types , and the template hierarchy To separate the blog posts from your...
Is it possible to have one page with multiple items, or 2 blogs on a site?
wordpress
Long time lurker, first time poster, and big time PHP noob. Apologies if my question is a little vague, but i have the code below and I know im doing some sort of schoolboy error but it just wont send the form contents to a post. The basic out line is one form, you submit a url, then another form appears with meta data...
See my comments above, but part of the problem is that you are checking that <code> $_POST['action'] == "new_post" </code> In the example you've given you have commented out the hidden 'action' field ; which, in any case is set to <code> post </code> not <code> new-post </code> . I believe you a trying to check the non...
Cant get front end form to post to wordpress
wordpress
Very similar to this previous question: stackexchange-url ("Changing &#39;rewrite&#39; argument after custom post type is registered") I am trying to make MarketPress Products hierarchical - I can do it with hacking the plugin files, but I would like to stay away from them if I can. Is it possible to change arguments o...
And as it usually happens, I find the answer a few minutes after posting the question... So here's what I did in my theme's functions.php file to solve my problem: <code> function modify_products() { if ( post_type_exists( 'product' ) ) { /* Give products hierarchy (for house plans) */ global $wp_post_types, $wp_rewrit...
Change custom post type to hierarchical after being registered
wordpress
My blog, the Posts page here: http://richardclunan.com/blog - displays full blog posts. I'd like it to display only the intros to the posts, and users click into a post to read the full post -- because users will then be able to more easily scroll through the posts to decide which ones to read. How do I make the page r...
You need to go inside the code of your category.php and... Change: <code> the_content(); //or similer </code> to: <code> the_excerpt(); </code> Goog luck.. Revised Answer for twenty eleven theme: 1. Open content.php and search for this line: <code> &lt;?php if ( is_search() ) : // Only display Excerpts for Search ?&gt;...
How to make a posts page display only intros of posts?
wordpress
Forgive me if this is too basic of a question... I am using Twenty Eleven and am wanting to only allow my "news" category show on the front page, excluding all other categories. How can I do this?
<code> $args = array( //post basics 'post_status' =&gt; 'publish', 'post_type' =&gt; 'post', 'posts_per_page' =&gt; 10 //order 'orderby' =&gt; 'date', 'order' =&gt; 'desc', //category query 'tax_query' =&gt; array( array( 'taxonomy' =&gt; 'category', 'field' =&gt; 'slug', 'terms' =&gt; 'news' //make this the slug of th...
Can I decide what categories show on my posts page?
wordpress
I have a WP 3.3 installed and running great. My client would like to confirm a valid email address by sending the user a confirmation email containing a link to "confirm". I have played around with Pie Register a little bit but cannot get it to send emails like it says it can. Are there other plugins or tools out there...
This plugin does exactly what you need - Pie Register From Wordpress.org Plugin Directory: Email Validation Hate fake emails? Make sure your users are not registering with invalid email accounts by forcing them to click a validation link that's sent out with their registration email. This sets there username to a rando...
How to have Wordpress send a user confirmation/validation email on signup
wordpress
I don't use Wordpress much, but I was wondering if anyone knew whether this would be possible in WP. Basically I want an online ordering system, so just like a normal cart where you can put things in your basket etc, except, instead of paying for it you just place an order and it generates an order email to me? Jonny?
That is very much possible. If you want some inspiration on that, look at plugins like WooCommerce, 66Cart, and WP-Ecommerce (to name just a few). You'll want to implement it through custom post types and it will probably take a decent bit of coding to build from the ground up, but you can definitely do it.
Ordering system through Wordpress
wordpress
I have tried what seems like every plugin to add the facebook like button to my site, but none of them are displaying on the page. I am trying to use the iframe method to avoid having to create an app id to use the XFBML method. The iframe gets created in the right spot, but nothing is showing on the page. Can anyone r...
For the most reliable results, you need to create and App at FB. Try http://wordpress.org/extend/plugins/simple-facebook-connect/
Facebook like button not showing up in iframe
wordpress
Is there a way to exclude all categories except one? I want to show a category and it's sub-categories as a dropdown menu, but the admin might add more subcategories to it so I don't want to limit what they can put in there by just including unique ID's. So I want to exclude all categories except 1 and it's subcategori...
Try the <code> exclude </code> parameter in the <code> wp_list_categories </code> . That should remove the selected categories and their descendants. EDIT: Must be getting late; this almost the opposite of what you wanted. To only include one category term in a drop-down menu (and all of its descendants), you can use <...
wp_list_categories() Exclude All Categories Except One
wordpress
While looking through the function reference entry for wp_insert_post(), I noticed that there's no parameter in the array it requires which will allow me to set the 'Featured Image' for a post, displayed as the post thumbnail in my theme. I have looked into functions like set_post_thumbnail(), as suggested by Mr. Benne...
You can set an image as post thumbnail when it is in your media library. To add an image in your media library you need to upload it to your server. WordPress already has a function for putting images in your media library, you only need a script that uploads your file. <code> $upload_dir = wp_upload_dir(); $image_data...
How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
wordpress
I don't want to write out something like this from 1 to 1000: <code> &lt;select name="number_pick" id="number_pick" &gt; &lt;option value="1" &lt;?php selected( '1', get_the_author_meta( 'number', $user-&gt;ID ) ); ?&gt;&gt;1&lt;/option&gt; &lt;option value="2" &lt;?php selected( '2', get_the_author_meta( 'number', $us...
you can save the 1000 conditional checks by using <code> str_replace </code> and your code would be much more efficient, something like this: <code> //create the select options $options =''; for($i=1;$i&lt;=1000;$i++) { $options.= '&lt;option value="'.$i.'"&gt;'.$i.'&lt;/option&gt;'; } //get the saved data $saved = get...
How do I add a dropdown list of numbers 1 - 1000 as an extra profile field?
wordpress
I have been trying this code to submit front-end post: http://pastebin.com/B8LGhsGA It is not redirecting upon clicking the submit button the form works fine but its not redirecting. When the post is submitted it loads the same page again.
That's beacuse you are calling <code> wp_redirect </code> after you have some buffer output from your code. you should change the order of the template functionally, meaning that first check if the form has been submitted and then show the page, so try something like this: <code> &lt;?php /* Template Name: Submit Work ...
Not redirecting upon front-end post submission
wordpress
I'm using the plugin advanced custom fields to create custom fields to create a relationship between two pages. The code below is looking at the relationship field and grabbing the page title and company logo of the linked page. The only problem is that instead of outputting the image url (so it displays the image), it...
You need the function wp_get_attachment_image_src() see http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src In your code it would be something like: <code> &lt;?php foreach(get_field('connections') as $relationship): ?&gt; &lt;?php $img = wp_get_attachment_image_src( get_post_meta($relationship-&g...
Convert attachment ID into url?
wordpress
I have images on my website which I do not really want stolen, I have a no right click plugin which will help, and I would like to stop people clicking on the image to display it on it's own in a browser window. I understand that anyone can access the source code and find the URL, I just want to make it a little more d...
To change the default for images (so you don't have to choose "none" on the image links to checkboxes every time you insert an image into a post), you can go to yoursite.com/wp-admin/options.php ; find the <code> image_default_link_type </code> option, and change the value from "file" to "none".
Can I stop images linking to themselves?
wordpress
I have added an image size using this: <code> add_image_size('property-featured', 484, 393, true); </code> It's worked very well for the past year and has generated about 1GB of images in that size, but this image size is no longer needed. I want to clear up the images that have been created over the year in this size....
I found a plugin that does this for me: Additional image sizes (zui) When you delete an image size that size will not be created for all NEW images you upload. However, images created for deleted sizes still exist on the server as well as the image attachment metadata for those sizes. This feature will physically delet...
Remove images (files) that were generated when using add_image_size()
wordpress
What do I need to ponder if I want to convert Twenty Eleven theme to XHTML? Is it just the matter of replacing the HTML5 for divs?
Probably the easiest way to do it is to set the doctype, etc and then use the w3c xhtml validator and just go through one by one and pick off the errors...but that will take A LOT of time, I strongly recommend you leave it as is.
Converting HTML5 to XHTML
wordpress
wp_list_bookmarks returns HTML that has a <code> ul </code> with classes <code> xoxo blogroll </code> . I'd like to add another class to that ul, but can't seem to find an elegant way to do so. wp_list_bookmarks does accept an argument "class", but that is applied to the li, not the ul. Is there some argument I'm missi...
There is a filter <code> 'wp_list_bookmarks' </code> for the complete markup. You can use it: <code> add_filter( 'wp_list_bookmarks', 'wpse40213_new_classes', 10, 1 ); function wpse40213_new_classes( $html ) { return str_replace( "class='xoxo blogroll'", "class='my_bookmarks blogroll'", $html ); } </code>
how to add class to the ul returned by wp_list_bookmarks
wordpress
I'm trying to use the new Settings API with a class based plugin to add a settings page. This is the code I have so far: <code> class simple_sample_plugin{ function simple_sample_plugin() { add_action('init', array(&amp;$this, 'init')); } function init() { add_action('admin_menu', array(&amp;$this, 'admin_menu')); add_...
try to change <code> do_settings_sections('sample_section1'); </code> to <code> do_settings_sections('sample'); </code>
How can I add an options page for my class based plugin?
wordpress
I am about to change the slug for my page's permalink. Since I dont want to loose the traffic, i would like to redirect the visitors to the new more SEo friendly link. Can I achieve this with the mod_rewrite? (I use Apache on Ubuntu) Or any other easier alternative? (I prefer not using any plugin if possible) Many Than...
Go with the easiest alternative of all: do nothing . No, really: WordPress itself handles redirects for renamed Post Titles. Edit Apparently, the retention of <code> _wp_old_slug </code> only happens for non-hierarchical objects . So, since Pages are hierarchical, they don't get to enjoy the auto-magic slug redirection...
How to redirect a link to a new link?
wordpress
I need to add something after each title of a specific menu called by wp_nav_menu() I tried <code> add_filter('wp_nav_title', 'testing_stuff'); </code> with <code> function testing_stuff() { $item-&gt;title = $item-&gt;title . ' testing'; return $item-&gt;title; </code> } without any success, i'm not familiar enough wi...
The following works, but with the following caveats. It will run for every menu , but it will not run for <code> wp_page_menu </code> , a usuall default callback if a menu can't be found. Finally, menu items aren't necessary pages - so you may want to do some logic to check that the menu item you are dealing with is a ...
Adding custom text in items titles from wp_nav_menu()
wordpress
I'm following this tutorial to build a front end form: <code> &lt;?php /** * * New Post Form for Custom Post Types for the Frontend of Your Site * By Jared Williams - http://new2wp.com * * Last Updated: 8/30/2010 */ // Check if the form was submitted if( 'POST' == $_SERVER['REQUEST_METHOD'] &amp;&amp; !empty( $_POST['a...
You need to make your processing form a template and apply it to a page if you want wordpress to recognize the form. Then you can set your action to the name of the page with the template applied to it and viola!
What should I write in the post action of this front end post form?
wordpress
I apologize if the question is confusing. Let me explain: I'm running a modified version of Twentyten and I've been doing the parent/child thing with my pages, which show up on the horizontal menu that I like to call the crossbar. However, I want to add pages that are not linked to from there, only from a sidebar widge...
No php or extra page template necessary. See http://codex.wordpress.org/WordPress_Menu_User_Guide and add/remove pages from the main menu and make a new sidebar menu. Or keep the page out of the main menu and add a simple href link to it in the sidebar.
How to prevent a page from being linked in the menu/crossbar
wordpress
I am saving the post-> ID in a session array to keep a history of the accessed pages for a specific custom post type. This code was added to that specific custom post type's template, so that the session data only updates for requests for this type. So, if the user loads the page with postID 1, then "1" is saved in the...
Of course, right after submitting it I find out the cause for the issue: The problem is caused by FireFox prefetching the other post in the background, resulting in those noticed 2 different postIDs per single page request. If I disable prefetching, then it behaves as expected, so will need to add code to check for the...
2 different post-> IDs for single page load only in Firefox
wordpress
I am working on an issue-based publishing system for a friend of mine. So far I have created a custom taxonomy called "Issue"; added several custom fields to the custom taxonomy (like "Issue number", "PDF URL" and "Is Published?"); and expanded the taxonomy management page with additional columns to show these custom t...
For something like this you might consider adding an 'action'; which appear when you hover other the item. The following code is not complete, and hasn't been tested - but should get you on the right track. Add the action First, to add the action link, use the <code> tag_row_actions </code> hook. (Keep in mind a functi...
How can I add buttons to a custom column in the taxonomy table?
wordpress
I've got an "Event" custom post type. Each post has a meta field for the actual event date, which cannot be the posts's publish date, as most all the event dates will be in the future. With that, I'm trying to create an archive (year and month) for past and future events based on the meta field. Just can't wrap my head...
I did something similar for a client a while back, I'll give you some of the code here as-is that you can possibly adapt to your needs. I'll warn you, it's quite a bit to parse through! First, I set up some custom rewrite rules to get the year/month URL structure and some query vars to pass the year and month to my tem...
Archives for custom post type based on a "date" meta value
wordpress
I'm working on a settings section for my plugin, and after reading over Wordpress's documentation which is in ROGUH DRAFT status , and also the Creating Options Pages - which is also in "transition", I've been left with questions about how to correctly use the new Settings API to add an options page for my plugin. I ha...
I wrote a tutorial for Incorporating the Settings API in WordPress Themes . The only real difference for Plugins is that you'll use <code> add_settings_page() </code> instead of <code> add_theme_page() </code> . The rest should pretty much be the same.
How should I use register_setting, add_settings_section, & add_settings_field in my plugin's options page?
wordpress