question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I'm looking to format the bullets for the last item of the list. I'm using Firebug to pinpoint where the menu item is and I have two options in front of me: Screenshot 1 Screenshot 2 - Includes bullet Now I'm looking at either using CSS or jQuery to select the last item. I tried using this CSS and it applies to the las...
You can use jQuery like this: <code> jQuery('ul.children li:last').addClass('last'); </code> And then CSS it with: <code> ul.children li.last { color: red; } </code> Hope this helps. Good luck!
Styling last item in ul
wordpress
Hello I've just recently installed wordpress today on a development linux server. Everything seemed ok until when I stupidly changed the wordpress url. Initailly it was just http://localhost/ but I changed that to http://localhost/wordpress in the settings area. Now I cannot seem to login again, because everytime I log...
Did you follow the steps outlined here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory Specifically did you copy the .htaccess and index.php files back to the root and edit the index.php file with correct filepaths as stated in points 7 - 9? Update The problem was solved by modifying these two options in...
Need help changing back the correct wordpress url
wordpress
I have a seperate database with lists of users, brochures and brochure URL's, and timestamps of when a brochure was ordered, but I want my database to update everytime a brochure (PDF) attachment is updated in the admin back end of wordpress. When a user requests a brochure they receive a reminder after a few days wiut...
You can hook into <code> add_attachment </code> and/or <code> edit_attachment </code> actions and carry out an update on your separate database with the appropriate info. In both cases the attachment ID seems to be the only argument but you can easily <code> get_post </code> or <code> get_post_meta </code> if you need ...
Updating seperate database when post attachment is changed
wordpress
My category page navigation doesn't seem to be showing up at all, what am I missing in my coding? <code> &lt;?php get_header(); ?&gt; &lt;div class="inner-page"&gt; &lt;div class="page-spacer"&gt;&lt;/div&gt; &lt;!-- Content Start --&gt; &lt;div id="content-top"&gt;&lt;/div&gt; &lt;div id="category-content-wrapper"&gt;...
You should take a closer look at the [http://codex.wordpress.org/Template_Hierarchy Template Hierarchy]. From what I understood in your code is that you're trying to list posts in the category where ID = 5. You can easily map that to the <code> category-slug.php </code> or <code> category-id.php </code> template files,...
Category pagination not working
wordpress
Basically I have this loop that shows all post. Inside of it I want to exclude post's from categories including shirts and hoodies, also the gallery category. Here is what I have so far. the code works without the 'cat=-gallery". But with it, it does not show any post's at all. <code> &lt;?php $limit = 5; $paged = (get...
When using cat in the query you need to specify the category id not name. Try this. <code> &lt;?php $gallery = get_cat_id('gallery'); $shirts = get_cat_id('shirts'); $hoodies = get_cat_id('hoodies'); $excluded_cats = '-'.$gallery.',-'.$shirts.',-'.$hoodies; $limit = 5; $paged = (get_query_var('paged')) ? get_query_var(...
How to have a category not show up in query post with page panigation?
wordpress
I have created a custom post type "portfolio" with something like this : <code> $args = array( 'labels' =&gt; $labels, 'public' =&gt; true, 'publicly_queryable' =&gt; true, 'show_ui' =&gt; true, 'query_var' =&gt; true, //'menu_icon' =&gt; get_stylesheet_directory_uri() . '/article16.png', 'rewrite' =&gt; true, 'capabil...
Try this code for adding scripts to the edit pages of your portfolio custom post type. <code> add_action( 'admin_print_scripts-post-new.php', 'portfolio_admin_script', 11 ); add_action( 'admin_print_scripts-post.php', 'portfolio_admin_script', 11 ); function portfolio_admin_script() { global $post_type; if( 'portfolio'...
Load a script just to custom post type in admin
wordpress
I have a custom post type where i need a field called country along with its flag. Now i am divided in between two choices: [1] to create a custom post type called country with title(name of country) and featured image(flag) ... or [ 2]. to register a taxonomy called country and add a custom field in the taxonomy calle...
If you need to display the flags of the countries in the post then the best option would be to use custom fields with your own function that will know to translate the value of the custom field in to the right country's image. You can also create a custom taxonomy for that with a custom field (best tutorial in the worl...
custom post type or taxonomy, which approach is better?
wordpress
Today I use: permalink_structure: /%postname% This gives me URL like this on my pages: #http://www.mypage.com/page1 #http://www.mypage.com/page1/page2 #http://www.mypage.com/page1/page2/page3 But I want it to be: #http://www.mypage.com/page1 #http://www.mypage.com/page2 #http://www.mypage.com/page3 How can I make this ...
One solution would be to create all your pages as root pages and then use the Menu page in "Appearance -> Menus" to define the structure of the pages. This assumes that your theme supports Menus, which the default Wordpress themes TwentTen and TwentyEleven do. Update: Here's a couple of links that might help you do thi...
Permalinks without subdirectories
wordpress
I have a website that displays a specific layout feature only on the homepage, and this is working fine. However, the client has suggested that they would like the website to be bilingual, and so I added a plugin to allow the transition between two languages. Unfortunately, the plugin adds <code> /?lang=cy </code> to t...
I'm not sure if <code> lang </code> is a reserved/used query variable in WordPress, but if it's not, then adding might help. Use a filter on <code> query_vars </code> like this: <code> function my_query_vars( $vars ) { $vars[] = 'lang'; return $vars; } add_filter( 'query_vars', 'my_query_vars' ); </code> Although WordP...
is_front_page breaks with url parameters generated by a plugin
wordpress
When writing a post or page in the post editor (not the Visual editor but the HTML editor) and clicking on the "link" button, a popup appears with <code> http:// </code> already prefilled. Is there a way to change this default text? For example, since I usually link internally to my own site I would want to use my base...
You could try hacking into wp-includes/js/tinymce/plugins/wplink/js/wplink.js and change: <code> if(!i.href||i.href=="http://") </code> (two times) <code> b.url.val("http:// </code>
Set or change default text in hyperlink popup in post editor
wordpress
As you can see below, for some reason the "Author" column displays extremely strange (like non-anti aliased) in Chrome. I added the snippet from the dev tools bar to show that I can't see any difference. Do you know why this happens?
This is happening because of this CSS rule that is generated in load-styles.php: <code> .widefat thead th:last-of-type { -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } </code> I'm not sure why this is here. To remove it, you s...
Strange font-style / font-weight on CPT list columns screen
wordpress
I'm looking for a way to set the default "View" options under post types in the admin area. For example, by default Posts will default to a "list" view instead of "excerpt" - I'd like to change this to excerpt by default - what would be the best way to achieve this? I've done a bit of searching on this, but am stuck in...
Although having the feature of persistent settings in core is nice, it may take quite a while before it's actually accepted. WordPress 3.5 is still quite far away. So let's augment the global <code> $_REQUEST </code> array instead. <code> add_action( 'load-edit.php', 'wpse34956_force_excerpt' ); function wpse34956_forc...
Set Default Listing "View" in Admin
wordpress
I'm looking for a way to set the default "Automatically add new top-level pages" to be checked when creating a new menu. I haven't been able to find anything on this - any help you could give me? Thanks!
<code> &lt;?php add_action( 'wp_create_nav_menu', 'PREFIX_nav_menu_auto_add_by_default' ); function PREFIX_nav_menu_auto_add_by_default( $id ) { $options = (array) get_option( 'nav_menu_options' ); if ( ! isset( $options['auto_add'] ) ) { $options['auto_add'] = array(); } $options['auto_add'][] = $id; update_option( 'n...
"Automatically add new top-level pages" Default
wordpress
this is my code <code> /* Update user information. */ if ( !empty( $_POST['url'] ) ){ update_user_meta( $current_user-&gt;id, 'user_url', esc_url( $_POST['url'] ) ); else{ delete_user_meta( $current_user-&gt;id, 'user_url'); } if ( !empty( $_POST['twit'] ) ){ update_user_meta( $current_user-&gt;id, 'twitter', esc_attr(...
You're not closing the first if tag. <code> /* Update user information. */ if ( !empty( $_POST['url'] ) ){ update_user_meta( $current_user-&gt;id, 'user_url', esc_url( $_POST['url'] ) ); } else{ delete_user_meta( $current_user-&gt;id, 'user_url'); } </code> Also, you should use <code> esc_url_raw </code> on a raw url a...
update user information
wordpress
I'm not sure is this possible,for example I have english,french and italian blog,they all use same theme,I just want when visitor is on french site for example to display date,(some strings like search,next page,...) on French,can I do it with theme localization an how,how to setup wordpress multisite to use this theme...
See http://wpmututorials.com/how-to/localization/ Basically after you install the language packs, go to that site and change the language option from the admin area.
Wordpress multisite,one theme,and different languages?
wordpress
I was told not to mess with the core files. Also, I don't want jQuery to load on every single page.
Get rid of the plugin/theme that's causing jQuery to load :) jQuery is shipped with WordPress doesn't mean that it's loaded every time by default, it's being loaded by a theme or plugin that you're using. Look for a call to <code> wp_enqueue_script </code> :) Good luck!
Why do we include jQuery in the header?
wordpress
On My category.php page i've got a list of categories with the title and the description. Here's the code: <code> &lt;?php $cat_id = get_query_var('cat'); $catlist = get_categories('hide_empty=0&amp;child_of=' . $cat_id); echo "&lt;ul&gt;"; foreach($catlist as $categories_item) { echo '&lt;h1&gt;&lt;a href="' . get_cat...
Something like this might work: <code> &lt;?php $cat_id = get_query_var('cat'); $catlist = get_categories('hide_empty=0&amp;child_of=' . $cat_id); echo "&lt;ul&gt;"; foreach($catlist as $categories_item) { echo '&lt;h1&gt;&lt;a href="' . get_category_link( $categories_item-&gt;term_id ) . '" title="' . sprintf( __( "Vi...
Code that displays images - images get shown multiple times
wordpress
I am building a WP site with an events feature. The events page was made with custom post types. I want to make it possible for people to search/ filter events by dates. For example, they can search for all events happening between 2nd December, 2011 and 1st March, 2012 and get results from events that have their dates...
There two things that you need to do to make this happen: 1) Create metadata for the data for each event 2) Query for the posts using meta_query For #1, you need to add a metabox that allows the user to add a date for the event. This data should be stored as metadata using the <code> add_post_meta </code> or <code> upd...
How do I search events between two set dates inside WP?
wordpress
I have a local copy of the latest version of wordpress that I set up using <code> svn co http://core.svn.wordpress.org/trunk/ </code> There is a diff that I want to pull into my local fileset: http://core.trac.wordpress.org/attachment/ticket/19371/19371.diff Is this something that I can do with subversion? What command...
The command you need is <code> patch </code> which is not specific to SVN. It's really easy to do. See this article: http://jungels.net/articles/diff-patch-ten-minutes.html
How do I implement a .diff changeset from core.trac.wordpress.org locally?
wordpress
maybe you can help: Bellow there is a simple code listing my blogs categories. I need some code that will not display the * ul is there aren't any categories to display * <code> &lt;ul&gt; &lt;li&gt;&lt;p&gt;Categories:&lt;/p&gt;&lt;/li&gt; &lt;? $master_cat = get_category_by_slug('Master'); $master_cat_id = $master_ca...
<code> &lt;?php $master_cat = get_category_by_slug( 'Master' ); $master_cat_id = $master_cat-&gt;term_id; $slave_cat = get_category_by_slug( 'Slave' ); $slave_cat_id = $slave_cat-&gt;term_id; $categories = wp_list_categories( 'echo=0&amp;show_option_none=&amp;orderby=name&amp;title_li=&amp;exclude='.$master_cat_id.','....
Not showing list if there aren't any categories to display
wordpress
Click on the Beers tab on this page: http://beernews.org/brewery/sierra-nevada-brewing/ UPDATE: Here is the Pastebin for Excerpt.php. Note that excerpt.php is called in other places on the site (like the home page and the first tab on the link above and no 'true' appears.) Here's the code: <code> &lt;div class="ui-tabs...
I am referenceing http://pastebin.com/dRfLY1et In line 74 either delete <code> echo 'true'; </code> or comment it out. That should keep it from displaying.
Why am I seeing 'true' next to these timestamps?
wordpress
Based on some advice I read[1], I have meticulously named all my plugin php files with my adopted plugin prefix, being 'wpsm-' in this case. All my class files have the additional 'class' qualifier, making their prefix 'wpsm-class-'. Now, while doing some early morning housekeeping, trying to get zoned into serious cod...
There's certainly no need to name plugin files with prefixes (although some plugin authors like to do this). I suspect the advice you read was referring to functions within your plugin files. Structuring you plugin folders as you suggest (using a class folder) is fine. See this link for more information on writing plug...
Advice on naming files for a plugin
wordpress
I'm souping up a WP theme with the BuddyPress plugin to make a cool hybrid of sorts between the two. Anyway... I'm using the following to grab author RSS urls. The problem being the colon ":" is being stripped on the pages and I can't figure out why. Does anybody have a solution for this? <code> &lt;a href="&lt;?php ec...
No idea why your colons are getting stripped out. Your original code, or @EAMann's answer, should both work unless you have some very strange filter going on. But using built-in functions to get permalinks should make your life easier in general than trying to concatenate them yourself. Try this: <code> &lt;a href="&lt...
WordPress Stripping Colons?
wordpress
I am using the advanced custom fields plugin to upload images for an image gallery. I am attempting to retrieve the different sizes of images that are saved in the uploads folder and having problems. $image = wp_get_attachment_image_src(get_sub_field('image'), 'full'); When I echo out the results of this I get nothing....
What's in get_sub_field('image')? wp_get_attachment_image_src() parameter 1 should be the attachment id, not the attachment src, if that's what you have. I use the following function to get an attachment ID from an image url as as far as I know WP doesn't have a method for this at present. <code> function get_attachmen...
wp_get_attachment_image_src() with advanced custom fields returning empty
wordpress
I am working on a plugin and want to change the default post date to something like 'posted one min ago' OR 'posted 1 hour ago', OR 'posted on month ago'.
Straight from my framework as <code> human_time_diff() </code> involves caching. <code> /** * Time since an entry was posted * * Adapted from binary bonsai * @link http://binarybonsai.com/code/timesince.txt * @license unknown - original source unavailable * * @todo check human_time_diff(); as a replacement * @link http...
Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
wordpress
I have one option on a settings page that can have between 1 and 5 values. I have a basic understanding on how to set up single value settings using the Settings API, but how do I go about generating the markup etc. for the setting with a variable number of values?
If you are using the Settings API correctly, you should be using the <code> add_settings_field </code> function. The 3rd argument in this function is for the callback function that will generate the HTML for the form field for the individual setting. The Codex states: Function that fills the field with the desired inpu...
How can I include a setting that has a variable number of values in a settings page using register_setting?
wordpress
Is it possible to show posts for a single category? I tried browsing to the URL <code> http://mysite.com/category/foo </code> which does show all of the posts with category foo, but the posts lose their formatting in the listing. I'd like a full paginated listing of posts that keeps formatting. Do I need to write a plu...
It sounds like you actually may need to do very little to get this working. It seems as though you have a template hierarchy issue. In WordPress, a number of variables are considered when making a decision about which template should be used to show the content generated by a specific URL. If you take a look at WordPre...
How can I show posts for a single category?
wordpress
I'm looking for a plugin, which would allow editing of certain predefined template regions. For example: I define that footer text is editable and administrator is able to edit just that, without touching code in template editor.
stackexchange-url ("Wyck") pointed me to this answer: stackexchange-url ("What methods to use to create small, editable pieces of text for static pages?"). And WP-Blocks was exactly what I needed after a few compatibility fixes :)
A plugin, which allows editing certain template regions
wordpress
I'm building an extensive user backend on a WordPress news website. One of the features I've noticed many major sites have is the ability for logged in users to follow headlines from users or categories they select. Forbes took the technology from TrueSlant in its acquisition and I know as a fact it is WordPress. Is th...
I don't know if you know about BuddyPress or not, but they have a plugin that will help you in your quest. It is called BuddyPress Followers which allows users to follow peoples activity. It should have options in it to only follow posts and whatnot. BuddyPress also makes WordPress more "Social"
WordPress Following? Social Users?
wordpress
How do I store multiple values in one <code> meta_key </code> through a radio input and then display the two values on the page? One value would be a text string and the other would be a link that would go with that text. These values would not change and would be populated by the data in the radio box. Here is the cod...
John, I'm not sure how you have the radio button set up, but WordPress easily handles multiple values in one meta_key. You simply need to place the values in an array before sending it to <code> update_post_meta </code> . For instance: <code> $array = array( 'foo' =&gt; 'foo_value', 'bar' =&gt; 'bar_value' ); update_po...
How to store multiple values in 1 meta_key with radio input?
wordpress
I've created a custom post type, let's call it 'product'. The site is also bilingual, without any plugins, where I place localised pages under parent language pages, such as: English Page 1 Page 2 Page 3 French Paginer 1 Paginer 2 Paginer 3 And so on. This means that my URLs are like <code> /%language%/%pagename% </cod...
Oh dear, turns out I need to touch up on my regex, the second match only matches one character. It ought to be: <code> '([\w]{2})/the-wines/([^/]+)/?' =&gt; 'index.php?pagename=$matches[2]&amp;lang=$matches[1]' </code>
Rewriting permalinks with custom posts
wordpress
Here is my problem: I have been blogging for about six years now at Blogsome.com . I've had no problems with it whatsoever, until a few days ago, when they suddenly announced that they were going to close down on a very short notice. So at the moment I'm looking for a new blog. At the moment I'm thinking of going for a...
I would use a step by step strategy. 1) Make a local installation of WP using XAAMP or similarl 2) Get 1.5.1 version from wp repository 3) Import all and check all is fine 4) Do a backup of imported data 5) Get a more recent version like 2.0 or so 6) Update and check all is ok and do a backup 7) Repeat step 5 and 6 wit...
Import a very old WordPress Version into new WordPress
wordpress
I'm updating my plugin to rely on internal functions of WordPress. I'm about to use <code> wp_generate_attachment_metadata </code> , but this function seems to be only available in the admin section. Is there an easy was to enable it on the frontend as well?
Put the following line before using the function. <code> require_once( ABSPATH . '/wp-admin/includes/image.php' ); </code>
using admin functions on frontend
wordpress
From the Codex , I'm using this function to return all children from a page ID without using SQL queries. Usage: <code> &lt;?php get_page_children( $page_id, $pages ) ?&gt; </code> $page is defined as a "List of pages' objects". What are examples of page objects I would use in this case?
They give you an example on that page by using WP_Query to query for all pages, then <code> get_page_children </code> just filters that list. the "without using SQL queries" part is a bit of a misnomer, since you have to have already queried the database at some point to get those pages. if you don't already have a res...
get_page_children arguments - page objects?
wordpress
I have a blog ( bernsteinbear.com ) that uses the TwentyEleven theme. I'm trying to make a custom page template for the front page (a blog page) that gets all the posts except in the "Comic" category. I managed to do that, except the pagination got messed up... How could I exclude a category from the main blog, have it...
Try this code in your template. <code> &lt;?php /** * Template Name: Exclude Comic Category */ get_header(); ?&gt; &lt;div id="primary"&gt; &lt;div id="content" role="main"&gt; &lt;?php query_posts( array( 'category_name' =&gt; 'comic', 'paged' =&gt; get_query_var('paged'), 'posts_per_page' =&gt; 5 ) ); ?&gt; &lt;?php ...
Custom Page Template and Category Exclusion
wordpress
WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well. Any suggestions to condense/optimize it? <code> // Only show posts related to current author add_action('pre_get_posts', 'query_set_only_author' )...
Ok I figured it out. Here's the optimized code: <code> // Show only posts related to current user add_action('pre_get_posts', 'query_set_only_author' ); function query_set_only_author( $wp_query ) { global $current_user; if( is_admin() &amp;&amp; !current_user_can('edit_others_posts') ) { $wp_query-&gt;set( 'author', $...
Help to condense/optimize some working code
wordpress
I have a general question about the themes development. When I develop a theme for distribution (free or commercial) is it a better practice to keep all the default templates file in my theme even though i do not use all of them ? For exemple if i develop a theme without blog feature, is it a good practice to keep sing...
It really depends: What is the intended purpose of the Theme? Is it a "special use" Theme, or merely designed for static Pages but not for blog posts? What is the intended distribution method for the Theme? If the Theme truly is a "special use" Theme, then you only need to include the template files relevant to the int...
Do i need to keep all the default WP templates files in a theme?
wordpress
My basic scenario is the following: I have a directory on my server that gets filled with images via ftp every once in a while. I would want to move these images to the wp upload directory and then add them to the media library with <code> wp_insert_attachment() </code> . I thought <code> wp_handle_sideload() </code> t...
Your files array needs to mimic the $_FILES global so you need to make a dummy page with some file inputs that prints or dumps the contents of $_FILES to see how it is structured. Make a variable that looks like that with your data and pass that <code> wp_handle_sideload() </code> . EDIT: This answer was correct at the...
Uploading Images to Media Library via wp_handle_sideload() fails
wordpress
is there a good and efficient way to fetch all WPMS blogs with archived set to true? Because there doesn't seem to be a function to get all blogs I have added the admin user to all blogs. Then I do a <code> get_blogs_of_user(1, false) </code> . This fetch all blogs that are active, but I'm looking for an efficient way ...
You can go directly to the database via <code> $wpdb </code> . <code> &lt;?php $wpdb-&gt;get_results( "SELECT * FROM $wpdb-&gt;blogs WHERE archived = 1" ); </code> Or wrapped up in a function: <code> &lt;?php function wpse34731_get_archived_blogs() { global $wpdb; if( empty( $wpdb ) ) return; $blogs = $wpdb-&gt;get_res...
Efficient way to fetch all archived WPMS blogs
wordpress
I've been working on this shortcode w/o any success... <code> function loop_shortcode( $atts = '' ) { '&lt;div class="clear"&gt;&lt;/div&gt; &lt;div class="childs grid_12"&gt; &lt;?php $the_query = new WP_Query( array( "post_parent" =&gt; "8", "post_type" =&gt; "page", "posts_per_page" =&gt; 4, "sort_column" =&gt; "men...
There is a multitude issues wrong with the above. For one, <code> post_parent </code> in the query arguments needs to be an integer. You're assigning it a string. A number of your calls to wordpress functions, such as <code> the_excerpt() </code> and <code> wp_reset_query() </code> are missing ending semicolons. <code>...
Short code to display a loop
wordpress
I let users add posts in draft status. After I check and see that everything is ok, I publish them. I noticed that drafts created two days ago change date after being published. Is there any way of keeping that original date?
you need to manually set the publish date.
Keep post's draft date after publishing?
wordpress
Read below if you want to start from where I left off in core. But the basic question is: I need to add a "title" attribute to my stylesheets and wp_enqueue_style() doesn't allow for that parameter, as far as I can tell. Other than a hard embed, are there any ways WordPress allows us to add the title to a stylesheet? I...
Okay, here's where I'm at with a solution. <code> wp_enqueue_style( 'my-handle', 'mystyle.css' ); global $wp_styles; $wp_styles-&gt;add_data( 'my-handle', 'title', 'my_stylesheet_title' ); </code> Don't like using the global. Is there something better?
Add 'title' attribute to stylesheets with wp_enqueue_style()
wordpress
Need some help from you. It's a matter of classification. Here is the deal: I've got a custom post type about movies and I set up some custom taxonomies (non hierarchical, so acting like tags) for the crew. So I've got "Director", "Screenplay writer" and others. I.e. Movie: The rise of Wordpress Director: John Doe Scre...
Since it looks like the "personal pages" are important in your project, I suggest a different approach. Use two distinct custom post types, one for the movies (the same you are already using) and one additional for the crew. You can create relationships between these custom post types using custom code or a specific pl...
Shared terms between taxonomies
wordpress
I did a copy of a production site to a development site, but the header_image doesn't work after the copy. The copy was done by doing a copy&amp;replace of the host in the db dump file. Everything seems to work except that I now only get the default custom header image and not the one that was earlier configured for ea...
It is not recommended to make a simple search&amp;replace in the dump file when moving to another host, because of the presence of serialized data in some database fields (usually options fields of core and plugins). I would recommend to use one of the following migration plugins/scripts to handle the data conversion w...
header_image not working after site copy
wordpress
I have a front end submit form and would like to include a two extra custom fields which will hold Latitude and Longitude values. I want the users to select the location on a map which will be included in the form. Anybody know a good way of doing this, or any tutorials? Thanks!
Take a look at this I did for a client: http://lpoc.co.uk/properties-for-sale/ A user can click the map and choose where to search. When a user clicks it updates a couple of hidden fields. Feel free to look at the source code to see how its done. If you want a more in depth description of the google maps api and javasc...
Google Map Latitude and Longitude values in form
wordpress
We had an old site that had html pages in it. One of the pages in that site was linked to from many other sites. Now we moved to a WordPress site, and we created a page with that name, but of course it doesn't have the ".html" extension, so links to that page lead to an empty page... I saw a plugin that adds html extes...
I would just add a rewrite rule to your .htaccess file of something like: <code> Redirect 301 /oldpage.html http://domain.com/newpage/ </code> see: http://www.javascriptkit.com/howto/htaccess7.shtml
Add .html extension to only one page in my Wordpress site
wordpress
In author.php, i have the list with the posts written by the author. I'm trying to get the total number of votes, from the author posts. All posts have a post_meta with a numbered value. i need to count the total votes from all the posts that made from this user/author. Is that possible? is a query available, that can ...
Assuming that you have a loop within your author.php file, grab the required metadata for every post within it, add it into a variable and display that after the loop has finished: <code> $author_vote_count = 0; //declare vote count variable before the loop &lt;?php while ( have_posts() ) : the_post(); ?&gt; // the stu...
Get author total post votes from post meta
wordpress
here's the code for my archive page.. <code> &lt;?php /* Template Name: Archive Page */ ?&gt; &lt;?php get_header(); ?&gt; &lt;div id ="maincontent"class = "group"&gt; &lt;?php include'leftsidebar.php';?&gt; &lt;div id = "allcontent"class="archive"&gt; &lt;?php if (have_posts()) : ?&gt; &lt;?php $post = $posts[0]; // H...
I'm assuming 'Archive Page' is a custom template and not either of the WP archive pages (category/date/author/tag/taxonomy). Try using this: <code> &lt;?php add_filter('the_content', 'trim_content'); function trim_content($content) { if(is_archive()) { //use your own trick to get the first 50 words. I'm getting the fir...
Archive limit the text of the_content
wordpress
Trying to list the categories for post separated by a comma with link to the category archive. <code> &lt;?php foreach((get_the_category()) as $category) { if($category-&gt;name==$homecat) continue; $category_id = get_cat_ID( $category-&gt;cat_name ); $category_link = get_category_link( $category_id ); echo '&lt;span c...
You can use the_category if you are in the loop: <code> &lt;?php the_category(', '); ?&gt; </code> If not, then use this code: <code> &lt;?php $output = ''; foreach((get_the_category()) as $category) { if($category-&gt;name==$homecat) continue; $category_id = get_cat_ID( $category-&gt;cat_name ); $category_link = get_c...
Category List With Comma & Link
wordpress
I'm facing a WordPress strange behavior. One of my posts is not showing up. If I open post editor I can find the post full text and in my home page I can see an excerpt of this post. Does anybody have any idea how to fix this?
You other posts are very much visible.This seems to be a strange behavior indeed.Your blog seems to be good enough performance wise. I would suggest you try to delete the post and prepare a new one . May be this must solve the problem .
My post does not show up
wordpress
I would like to manage some files available for download from my WordPress page. Because the file should be attached to more pages I would like to define pages where file is avalable for file directly. I don't want define the same file for lot of pages in my application. Do you know some plugin which should help me wit...
I solve this issue myself. I used <code> file-un-attach </code> plugin, which allows attach same file to more pages. This plugin uses custom find method which finds by text in title and content. If you write <code> "" </code> (double quotes) into search box it will find all pages in application. Result set is limited t...
WordPress file manager plugin
wordpress
if sitting on sidebar-1, I need my widget to behave differently than if it were on sidebar-2. How can i detect the sidebar it is sitting on from within the widget() function? The widget contains a list of links to posts. Depending on which sidebar, it should use a different custom image size version of its thumbnail. S...
there isnt a clean way of handling this, since there isn't a conditional for checking which sidebar is in use, just whether or not it exists. however, you could do the following: make two different versions of the widget (which would make it "future proof" in regards to what widget names could exist). add a checkbox to...
How could a Widget behave differently depending on sidebar
wordpress
I'm seeking advice on how to structure the categories so it fits well my page structure: The main highlight is a single post and the secondary highlight boxes will probably contain a slides showing more than one post each, and the grid at the bottom will have four posts. I don't know how i can categorize that and still...
It's not really a category issue unless you want different areas to only show different actual categories. What I've normally done in this case is either use custom fields or set up a custom 'presentation' taxonomy so on a post I can check a box to say "this post is a 'Main Highlight'" or "this post is not-so-important...
I need advice on how to structure the categories according to the layout i have
wordpress
I want to load my javascript and exclude 1 page, so I tried the following without success: <code> function mypage_scripts() { if ( !is_admin() ) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', true, '1.6.2', false); wp_enqueue_script('jqu...
Try giving your function its own parameters and do a template_redirect, something like this: <code> &lt;?php function mypage_scripts() { if ( !is_admin() ) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', true, '1.6.2', false); wp_enqueue_...
Enqueue script on every page except one
wordpress
I am trying to extend the Walker_Nav_Menu walker to make some changes to the way WP outputs menus. The method I have to override is start_el, so I created my Walker and copied the base method: <code> &lt;?php class myCustom_Walker_Nav_Menu extends Walker_Nav_Menu { function start_el(&amp;$output, $item, $depth, $args) ...
Found a solution in a very similar question. The accepted solution worked perfectly for me, although it involves fixing a wordpress bug... stackexchange-url ("Add &#39;has_children&#39; class to parent li when modifying Walker_Nav_Menu")
I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
wordpress
I'm breaking my head trying to create a short code to display certain loop, however I'm totally cut, I can not figure it out how to do it, since it's the first time I try to do it... I do now want to set any parameter, just put exactly as it if... I would appreciate if anyone can light me... This is the code I want to ...
Take a look at my latest plugin <code> ShortCodes UI </code> which lets you create shortcodes without coding, all you have to do is paste your loop inside the right field of the shortcode (PHP) and you are done.
Create a short code to display a specific loop
wordpress
I am ussing bbPress and want to extend the BBP_Shortcodes class in order to replace a function with my own. Here is my basic snippet which seems to do nothing: class WPTUMBLE_Shortcodes extends BBP_Shortcodes { /** * Display an index of all visible root level forums in an output buffer * and return to ensure that post/...
I can't tell you what you're doing wrong with your includes and such, but your method of extending the class is basically correct. However, the most likely scenario that I can see is that your add_action is basically executing in the wrong place. Also, you're doing-it-wrong by allowing the original action to stand inst...
How to extend a class in WordPress?
wordpress
I'm looking to retrieve an RSS Subscription count. How do I return the number of subscribers without use of Feedburner or use of a plugin?
A reliable subscriber count is not possible, unless you require registration to access your RSS feeds. For example, my site is being autopolled by 5 other sites using auto aggregators, including 2 or 3 devices of mine, including Google Reader. I count as 1 subscriber, yet if I counted subscribers by how many accesses I...
RSS Subscriber count
wordpress
I'm trying to automatically create a new post when a post containing a certain custom field is saved - hooking an insert_post function into save_post. This generates an infinite loop. I found some answers to this problem, suggesting I should check the post type before inserting. However, the following code still gives ...
This is because the first time you go round the loop $post is the current post. But the second time you go around the loop, $post has not changed. The same thing happens the 3rd, 4th, 5th, etc Because the $post variable is the current post of that page, not the post you've just saved/inserted, the loops if statement wi...
save_post + insert_post = infinite loop
wordpress
My question is concerning dynamic sidebars and wrapping the dynamic sidebar code in the <code> &lt;ul&gt; </code> tag. When I have widgets/dynamic sidebar enabled do not add widgets to the sidebar, and do not wrap the dynamic sidebar php code in the <code> &lt;ul&gt; </code> tag my theme it is XHTML valid. But when I a...
I've had similar issues in the past with custom sidebars. It was caused by the improper use of the <code> &lt;ul&gt; </code> and <code> &lt;li&gt; </code> tags. I was adding them in the sidebar.php file and not inside the function. Now I use this code and with 6 active widgets I have no errors. Take a look at the code ...
Dynamic Sidebar and XHTML Validity?
wordpress
I have an index of posts where I'm wanting to insert a Facebook Like button for each post. Thus far, I've set all Open Graph data in the head for single posts. Any ideas on using the open graph data (particularly, the thumbnail) within the loop?
Short answer: you can't do that, that's not what OpenGraph data is, does, or how it works. Long answer: OpenGraph applies to the single post pages only, realistically. When you're putting a like button (for example) onto each post on a archive page, the like button is going to point to the permalink of the single post....
Open Graph in Index Loop
wordpress
I am trying to delete a post with its all attachments. This is the function that i came up with right now; <code> function remove_post(){ if(isset($_POST['post_id']) &amp;&amp; is_numeric($_POST['post_id'])){ $post = get_post($_POST['post_id']); if(get_current_user_id() == $post-&gt;post_author){ echo 'ee'; wp_delete_p...
Maybe this works <code> function remove_post() { if(isset($_POST['post_id']) &amp;&amp; is_numeric($_POST['post_id'])) { $post = get_post($_POST['post_id']); if(get_current_user_id() == $post-&gt;post_author) { $args = array( 'post_parent' =&gt; $_POST['post_id'] ); $post_attachments = get_children($args); if($post_att...
delete post also attachments
wordpress
I'm creating a plugin and I want to automate the creation of a MySQL Trigger on a table. The problem seems to be that $wpdb-> query doesn't appear to accept either multipart statements and/or formatted queries. If I print and run the following query in phpMyAdmin it returns success. I also noticed if I formatted the qu...
After much trial and error I finally figured out a solution using mysqli. I consider it a acceptable solution since the query will only be run on plugin updates. <code> $mysqli = new mysqli(); $mysqli-&gt;connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql = " DROP TRIGGER IF EXISTS {$wpdb-&gt;get_blog_prefix($site-&...
Multipart/formatted MySQL query problem
wordpress
I have this problem and maybe you can help me. I want to get a list of all children pages from page (with id 20) and then get the featured image from each one and resize with Thumbnail. Right now I get the_title from each one but not the Image so think there is a source problem. here's the code: <code> &lt;?php $args =...
Never mind about my question... here is your answer Put this function on your functions.php <code> // Get Featured Image Path function get_featured_image_link($size){ global $post; $get_featured_image_link = get_the_post_thumbnail($post-&gt;ID, $size); preg_match("/(?&lt;=src=['|\"])[^'|\"]*?(?=['|\"])/i", $get_feature...
Source problem for children page image
wordpress
My today's question is... is there any way to auto add an custom (whatever I want) Read more... each time I use the_excerpt or get_the_excerpt function??? Thanks in advance
From Twenty Ten's functions.php: <code> /** * Returns a "Continue Reading" link for excerpts * * @since Twenty Ten 1.0 * @return string "Continue Reading" link */ function twentyten_continue_reading_link() { return ' &lt;a href="'. get_permalink() . '"&gt;' . __( 'Continue reading &lt;span class="meta-nav"&gt;&amp;rarr...
Add custom read more to the_excerpt and
wordpress
How can I create a slug for a page in WordPress? I see that there are custom formats available, but I would like to be able to specify things like: <code> mydomain.com/about mydomain.com/home mydomain.com/portfolio </code> etc. Is there a plugin or technique that I could use to accomplish this?
The custom permalink you will most likely want to use is /%postname%/ Which will get the structure that you show above. (mydomain.com/about, mydomain.com/home) If you want to edit the slug, it's right underneath the title of the post ("Permalink"), click edit.
Create a slug for a page in WordPress
wordpress
I want to set a group of posts grouped by date as a list. Below is what I would like to have: <code> Day... &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Lorem ipsum&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; Previous day... &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Lorem ipsum&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Lorem ipsum&...
I usually perform a simple check to see if that day has changed. <code> &lt;?php $day_check = ''; while (have_posts()) : the_post(); $day = get_the_date('j'); if ($day != $day_check) { if ($day_check != '') { echo '&lt;/ul&gt;'; // close the list here } echo get_the_date() . '&lt;ul&gt;'; } ?&gt; &lt;li&gt;&lt;a href="...
Group posts by date with a list
wordpress
I'm using the following code to display the latest 3 blog posts on my front page but I need to add a <code> last </code> class to the 3rd post on the ID <code> blog </code> . <code> &lt;?php $args = array( 'numberposts' =&gt; 3 ); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?&...
Something like this should work for you. <code> $args = array( 'numberposts' =&gt; 3 ); $lastposts = get_posts( $args ); $count = 1; foreach($lastposts as $post) : setup_postdata($post); ?&gt; &lt;div id="blog" class="&lt;?php if ($count == 3) : ?&gt;last&lt;?php endif; ?&gt;"&gt; &lt;div class="blog-header"&gt;&lt;a h...
Defining 'last' class on foreach blog posts
wordpress
Apologies in advance if I meander in this question, I am trying to grasp my brain around the different licensing models and yes, I know most of you are not lawyers. I am developing a WordPress Plugin that I intend on publishing a free version to the WordPress Plugin Directory and a premium version sold elsewhere. My pl...
The GPL requires that any derived works are also licensed under the GPL. For the purpose of WordPress plugins and themes, that means any elements which rely on WordPress (ie, use or extend WordPress classes and functions) must also be GPL. You are allowed to license other elements not reliant on WordPress (eg CSS, imag...
Using MIT Licensed niftyPlayer in a WordPress Hosted Plugin (Premium and Free versions)
wordpress
I'm just analyzing my custom Walker Class because it frequently skips over some post_meta data that I append to the $output HTML. Even though the Custom Fields are set, they are ignored by the Walker. They are only shown when I go back to my functions.php, and re-run the function that sets the Custom Fields. The extrac...
I ended up running the function twice on itself. That way, once the walker updated the last element, it went back up to the top to update the first.
Walker Class : extract function and wp_list_pages
wordpress
I need to used TextArea with Wysiwyg editor. That works when textarea is write on page ( Not dynamic , static ).. but my problem is for dynamically textarea. My code : <code> add_action('admin_head', 'load_tiny_mce'); function load_tiny_mce() { // The 'mode' and 'editor_selector' options are for adding // TinyMCE to an...
Add this function to you JavaScript: <code> function textarea_to_tinymce(id){ if ( typeof( tinyMCE ) == "object" &amp;&amp; typeof( tinyMCE.execCommand ) == "function" ) { tinyMCE.execCommand('mceAddControl', false, id); } } </code> then when you create the textarea dynamically call it and pass the textarea's id to it....
Dynamically textarea with TinyMce editor
wordpress
On my site I've got two types of users, Subscribers and Partners. I've used Cimy User Extra Fields to add additional fields to the registration form. I've also used a plugin called WP Roles at Registration . This plugin adds a drop down box on the registration form so when a user registers they can pick their own role....
I have kept using Cimy User Extra Fields but got rid of WP Roles at Registration and left it as a manual process. User register as normal and then manually change a persons role.
User registration approval based on role selected
wordpress
I want to get a course rolling where I show a new link for a weekly lesson to a subscriber, based on how many weeks the subscriber has been registered. Say, the subscriber goes to the course page and gets shown something like the schematic below. http://imageshack.us/photo/my-images/845/coursedesignwordpress.png/ Visit...
Your task is fairly simple given the tools that wordpress provides. Step 1: The date/time a user registers an account at your site at is not naturally recorded by wordpress. You'd have to manually add such a functionality. It would make sense to save that to the wp_usermeta table. Have a look the php <code> time() </co...
How To Display Pages Based On Subscriber Signup Date
wordpress
I added template to my WP posts, so when you click Add New content area alreday with text. Template smt. like this <code> &lt;div id="myDiv"&gt;&lt;p&gt;Add your text here&lt;/p&gt;&lt;/div&gt; </code> If user has Admin or Editor roles then it works great, but if user has Author role id sprips, and I got <code> &lt;div...
WP stripts HTML for authors. I had this problem too. I'm sure this post can help you. stackexchange-url ("How can HTML be allowed in Author Bio?") or this: https://wordpress.org/support/topic/authors-can-not-embed-video#post-1483017
WordPress strips some attributes for author posts
wordpress
Is there a config in WP that allows you to store your FTP credentials? I'm using the Linux webserver at work to develop and it's really annoying to have to but the credentials in every time I add/remove a plugin/theme. Anonymous access is a no-no, so I hoping that this config exists... Thanks.
<code> define('FS_METHOD', 'ftpext'); define('FTP_BASE', '/path/to/wordpress/'); define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/'); define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/'); define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub'); define('FTP_PRIKEY', '/home/username/.ssh/id_rsa'); d...
WP Config for FTP credentials
wordpress
Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
Exclude post from home page and archives, but still public
wordpress
How can I include author archive pages in the default search results? For example if I have an author name Billy Joe and I type his name into the search box a link to his author archive would display.
Relevanssi can be configured to search in author names. It doesn't search in author descriptions.
How can I include author (their archive page) in search results?
wordpress
I just realized the following: <code> // Call the current user info global $current_user; // Add a capability // and set the 2nd argument ($grant) to false $current_user-&gt;add_cap( 'some_cap', false ); </code> Now I've successfully added a capability to the user, but denied her/him the access to this capability. If I...
I think you are using it right. I think it is actually a bug in WordPress. When you do the same for roles <code> $somerole-&gt;add_cap( 'some_cap', false ); </code> , it works as expected.
Add user capability and check against it
wordpress
I just upgraded the List Category Posts plugin from 0.18.3 to 0.21 and my website has failed. I've determined that the difference causing the failure is that the previous version passes a string parameter to get_posts() while the new version sends the arguments as an array. The problem is that the default value for pos...
Since version 0.19, the plugin sends an array to <code> get_posts </code> to support custom taxonomy (see here ). I just uploaded version 0.21.1 with a small bugfix, it doesn't pass the <code> post_parent </code> parameter to <code> get_posts </code> if you didn't set it. Please give the new version a try and let me kn...
List Category Posts V0.21 upgrade breaks site
wordpress
I have parent posts (custom post type hierarch=true) with ID 1, 2, 3, 4. The parent posts with ID 2 and 4 have child pages. I need to retrieve only posts 2 and 4 and all of their child pages. Something like this <code> $argsch = array('orderby' =&gt; 'date','order' =&gt; 'DESC','post_type' =&gt; 'products', 'include' =...
You have two options: Call get_posts multiple times: one for the parent pages using <code> post__in =&gt; array(2,4) </code> , and two for the child pages of each parent with <code> post_parent =&gt; 2 </code> and <code> post_parent =&gt; 4 </code> and finally merge all the results into a single array. Write directly y...
get_posts only children from certain parents
wordpress
I would like to know what does these meta_value means for wp_usersettings meta_key in wp_usermeta table? meta_key: wp_usersettings meta_value: m1=o&amp;m3=o&amp;m0=o&amp;m2=o Thanks
When a user changes their admin settings; like the screen options, posts per page or moves metaboxes around or 'hides' them, it is saved in their user settings. So if user settings are blank - the user has never tailored their admin environment. Aside: (I use this to great advantage in one of my plugins to simplify the...
wp_usermeta wp_usersettings
wordpress
What is your preferred method of debugging Wordpress Applications when writing custom behind-the-scenes SQL calls, etc. ? Coming from a Rails background, I usually tail a log file that displays not only all the processes and views that are being seperately loaded into a template, but if there is an error, it will pin p...
Turn on <code> define( 'WP_DEBUG', true ); </code> and <code> define( 'SAVEQUERIES', true ); </code> . I prefer the format of the debug bar, http://wordpress.org/extend/plugins/debug-bar/ , which can be combined with the console, http://wordpress.org/extend/plugins/debug-bar-console/ . This script is great for profilin...
Preferred Method of debugging a wordpress SQL calls?
wordpress
I'm using the contactform 7 plugin and i want to add the title of the last viewed page (The page visited before the contact) to the dynamic field of the plugin with a shortcode. Is there a way to do that? I found this plugin Last Viewed Posts to display the last visited post. But I can't found a solution to add this to...
I think the best way to do this would be to use the Contact Form 7 Dynamic Text Extension , and then pre-populate the URL to the Contact Form page with the current post title. More details on how to do that in my answer stackexchange-url ("here"). The code to pre-populate the link in a post template would look somethin...
Add the last viewed post title to a contactform with shortcode
wordpress
In a loop, I want to display "Yesterday" if the date of the post(s) are dated from yesterday... So here it goes: <code> &lt;?php if( date('Yz') == get_the_time('Yz') ) { echo 'Today'; } elseif ( date('') == get_the_time('') ) { echo 'Yesterday'; } else { the_date(); }; ?&gt; </code> Would you guys know the correct synt...
As you discovered, one possible solution is something like: <code> &lt;?php $w_h = $w_d = 0; ?&gt; &lt;?php while (have_posts()) : the_post(); ?&gt; &lt;?php if ( date('Yz') == get_the_time('Yz') ) { if (!$w_d++) echo 'Today&lt;br /&gt;'; } elseif ( date('Yz')-1 == get_the_time('Yz') ) { if (!$w_h++) echo 'Yesterday&lt...
Check if date of post is yesterday
wordpress
In continuation of this thread stackexchange-url ("Mapping multiple URLs to same page in WordPress") is there any other way except redirect similar pattern URLs to same page. Our goal is to provide our guest and other authors there name/email specific URLs so that they can put those links on there website/blogs to enco...
here you go: <code> add_action('init', 'wp_new_flush_rewrite_rules'); //Run this action only ONCE if not you are looking at 2 extra db queries on every page load so dont forget to comment it out function wp_new_flush_rewrite_rules() { global $wp_rewrite; $wp_rewrite-&gt;flush_rules(); } add_action('generate_rewrite_rul...
Author Specific URL's in WordPress
wordpress
I have a site witch is a large database of people that have different knowledge in different domain... think about teaching (match, french, science etc...) On the site there is a page where you can search people base on different request, think of distance from home, grade, sex Now, i like to add a page where people th...
I will use gravity form... it make interaction with data easy... i have found type and view : http://wp-types.com/features/ that look nice too
Multi database link and mix and match email alert
wordpress
Terms like 'slug' and 'description' on custom taxonomy edit pages tend to mislead my client. Is there a way of removing these from the page flow? At the moment I'm using JavaScript, which isn't ideal. I was looking at <code> {$taxonomy}_pre_edit_form </code> and its ilk, but none of them seemed to offer the fields for ...
Looking at the source (edit-tag-form.php) it doesn't look like there is a way of doing this through filters, as the code is directly outputted as oposed to being held in a variable. All <code> {$taxonomy}_pre_edit_form </code> does is allow you to add code before the form. JS I think is the only way, and to be honest i...
Removing fields from category/taxonomy edit form
wordpress
I'm developing the wordpress file monitor plus plugin. Its purpose is to scan for altered files and it works fine for a single installation of WP. But when you look at multi-site it's not something that wants to be enabled on all sub sites, as they all share the same files and (to be honest) only a network admin should...
You could check if the constant <code> SITE_ID_CURRENT_SITE </code> matches <code> get_current_site()-&gt;id </code> . The following does this for the activation. During runtime you have to check it again. <code> register_activation_hook( __FILE__, 'force_main_site_installation' ); function force_main_site_installation...
Only allow plugin to be activated on root site of multisite
wordpress
On behalf of another, I'm trying to import content from a WordPress.com hosted site to a self-hosted installation of WordPress.com I've exported the XML file and imported it into the new site, but it looks completely different. Original: http://tbmsussex.wordpress.com new: http://tbmsussex.co.uk The pages are all over ...
It looks like you may need install and configure a slideshow plug-in (example: under Vertical Blinds). The shortcut "[slideshow]" in the text is what tells the plug-in to run a slideshow. The menu items under "Our Blinds" are in a different order - if there is a custom menu, configure it under Appearance-> Menus. You m...
How to import content from WordPress.com to a self hosted WordPress installation?
wordpress
I'm using jQuery UI for a few custom controls on the page edit screen and I've noticed that the styling of the jQuery UI dialogs are conflicting with the TinyMCE dialog. Specifically the buttons and title area look especially bad. I've looked through the jQuery UI css to see what could be removed to avoid any conflicts...
Turns out what I had to do was use the CSS Scope option in the jQuery UI download application. I was using the normal wp_register_style/wp_enqueue_style to put it in place and it would always conflict with the jQuery UI dialog styling that the Wordpress install of TinyMCE uses. After switching to using a scoped version...
jQuery UI styles conflicting with TinyMCE dialog
wordpress
There are post to Facebook/Twitter plugins but I can't find one for Google Plus. Does anybody know if such a plugin exists or if there is a better solution? It would be nice to have content automatically post to a Google Plus page!
Here is a plugin to display your Google+ feed in a widget: http://wordpress.org/extend/plugins/google-wordpress-widgets/ However, the reverse, of posting from WordPress to a Google+ profile/page is not possible, as the necessary API calls aren't available in Google+. One can read from a profile/page but not write.
Does a Google + RSS Plugin Exist?
wordpress
I have a custom post type named "Resources" which has a Taxonomy named "Types." I have it manually pulling each term which isn't the most elegant solution and every time there is a new term added, I have to add it in manually. I need a way for the Terms to populate with the posts associated listed below. I have a custo...
Try this piece of code for page template. I've used it on one of my projects. It outputs taxonomy term one by one with list of all posts with this term. (Just replace YOUR_TAXONOMY_SLUG to yours) <code> &lt;div id="content"&gt; &lt;h2 class="entry-title"&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt; &lt;div id="post-&lt;?p...
List all posts in Custom Post Type but group dynamically by Custom Taxonomies
wordpress
The dad from a friend of mine photographs bird feathers for hobby. He has about 6000 of them. I've been asked to find him an easy to use gallery, which should allow some kind of batch processing as it's a lot of photos. I've started off on Gallery2, but we're not on speaking terms anymore; what a piece of shit. Any sug...
WordPress can do a lot with images provided it's configured right, and exactly how you want it. http://ottopress.com/2011/photo-gallery-primer/ will give you the basics to then customise to your requirements. A great example of this kind of thing can be seen on Matt Mullenweg's site: http://ma.tt/gallery/
A proper gallery in wordpress?
wordpress
I'm sure there has to be a tutorial for this, I just can't find it. I'm also pretty confident there's numerous ways to do this and I'm looking for the best. I've never had to do this before, so I've never asked... I want to insert a DIV into a list of excerpts. For example, take a look at: http://www.premiumpixels.com/...
add a counter to your loop or use a conditional statement with <code> $wp_query-&gt;current_post </code> , just before the 'endwhile', and add the div when the counter/post number reaches a certain value. please paste the full code of your template into a http://pastebin.com/ and post the link to it here, if you need m...
Inserting a DIV Block Into a Listing of Excerpts?
wordpress
I am attempting to add highlighting to my search results in the theme that I am coding. I found the way to do it on this thread: stackexchange-url ("How to highlight search terms without plugin") and it worked wonderfully. However, it is conflicting with my read more link whenever a permalink contains the search term b...
Try this. <code> function search_excerpt_highlight() { $excerpt = get_the_excerpt(); $keys = implode('|', explode(' ', get_search_query())); $excerpt = preg_replace('/(' . $keys .')/iu', '&lt;ins class="search-highlight"&gt;\0&lt;/ins&gt;', $excerpt); echo '&lt;p&gt;' . $excerpt . '&amp;hellip;' . supralegal_read_more_...
Search results highlight breaks my read more link
wordpress
I'm trying to add the categories selector to the "page" editor workspace. The code below does the trick, however, none of the values are saved with the page. Any help much appreciated! <code> add_action('admin_menu', 'my_post_categories_meta_box'); function my_post_categories_meta_box() { add_meta_box('categorydiv', __...
You'll need to register the <code> category </code> taxonomy for the page <code> post_type </code> with <code> register_taxonomy_for_object_type </code> . This does the trick: <code> &lt;?php add_action( 'init', 'wpse34528_add_page_cats' ); function wpse34528_add_page_cats() { register_taxonomy_for_object_type( 'catego...
How to add categories to page editor?
wordpress
How can I retrieve the permalink to a user (author) profile dynamically outside the loop by ID? an alternative to <code> the_author_link() </code> , but for outside the loop. Example: <code> get_author_link($user_id); </code>
I believe the function you want is get_author_posts_url .
Permalink to user profile
wordpress
I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments. I've been modifying my theme to do this, but the theme is updated quite frequently and I don't want to create a custom version of it for a single li...
Here you go... Use this code: <code> &lt;?php add_filter('comment_form_defaults', 'change_allowed_fields'); function change_allowed_fields($defaults) { //All the comment form fields are available in the $defaults array $defaults['comment_notes_after'] = "&lt;b&gt;Markdown for the win!&lt;/b&gt;"; return $defaults; } </...
How do I alter the comment form 'allowed tags' text in a plugin?
wordpress
I want to create some custom pages for my theme that don't appear in the Page listing in wp-admin. I have the following class which intercepts the url. <code> class jtvRewrite { var $path = ''; function __construct($path) { $this-&gt;path = $path; register_activation_hook( __file__, array($this, 'activate') ); // Write...
Conditional variables are based on the main page query ($wp_query). If you want is_home() to be false, then you need to manually set it to false ($wp_query-> is_home = false) or override the main query such that it's not true anymore. Probably you'd do that in your template_redirect_intercept function there, or in the ...
Rewrite loading custom template file but is_home() returns true, and there's no 404
wordpress
I have a website which has about 10,000 users. I am converting this site over to Wordpress. The new site is ready to roll, but I have to bring over all the users. There are a number of plugins available to importing users from a CSV file, and I've got the CSV file ready to go. The plugin that I'd like to use is the fol...
I'm not familiar with the plugin, but this might be an option to work around it: Import the ids into the database directly using SQL (phpMyAdmin). Use the plugin to import the CSV and run the "update" on those now-existing users, so they receive their updated password email.
Import 10,000 Users into Wordpress WITH a specific ID for each user
wordpress