|
Bubblegum Wishes posted:Edit2: This is unrelated. Wordpress needs MySQL? Theres no way to get it to use a SQL server? Thanks to the great design of PHP, unless you use some sort of database abstractor (almost nobody does) the database functions in PHP are actually named mysql_query, pg_execute, mssql_execute and the like. I'm glad this is here, I've been looking at CMS type systems and finally settled on Wordpress because it's interface is so clean and it seems quite developer friendly, but it takes a while to figure out how to do things the Wordpress way. Like if you know Ruby but going to Rails is way different, or if you know Python and going to Django there's things that you need to learn.
|
# ¿ Jul 15, 2009 18:13 |
|
|
# ¿ Apr 27, 2024 16:07 |
|
If I have the ID of a user and need to look up information, is this the best way to do it? For example:php:<? function generate_profile_link($uid){ $first_name = get_the_author_meta('first_name', $uid); $last_name = get_the_author_meta('last_name', $uid); $link = sprintf("<a href='/People/profile/%s' >%s, %s</a>", $uid, $last_name, $first_name); return $link; } ?>
|
# ¿ Aug 1, 2009 21:52 |
|
atastypie posted:Is there a plugin that combines the javascript/css that all the other wordpress plugins install, so that there is only a single request for them? I hate it when a plugin includes the css inline below the header or when plugin javascript is loaded at the top of the page, instead of the bottom It sounds like the plugin author is using script or style tags instead of wp_enqueue_script and wp_enqueue_stylesheet like it's supposed to. Those functions are meant to buffer in all of the stylesheets and javascripts so when the rendering chain hits wp_header() it'll print out everything. tl;dr Wordpress already does this but the plugin or theme author didn't do it right. You could fix it actually by removing the tags in the plugin and doing something like this in the functions.php file php:<? function add_javascripts() { wp_enqueue_script('jquery'); wp_enqueue_script('jquery_roundcorners', WP_CONTENT_URL . '/themes/genetics/js/jquery.corners.js'); } add_action( 'init', 'add_javascripts' ); ?> NotShadowStar fucked around with this message at 14:03 on Aug 4, 2009 |
# ¿ Aug 4, 2009 14:00 |
|
That won't work if the plugin uses html tags instead of the wordpress functions, which is most likely the problem.
|
# ¿ Aug 4, 2009 17:37 |
|
e: gently caress me I forgot while(have_posts()). Big nevermind
NotShadowStar fucked around with this message at 18:04 on Aug 11, 2009 |
# ¿ Aug 11, 2009 18:01 |
|
mynameischainsaw posted:Anybody have favorite plugins for fostering a community? Looking specifically for a nice comments plugin or something. Why not just use bbpress?
|
# ¿ Aug 17, 2009 15:02 |
|
I'm working on exactly the same thing today. Hopefully I'll get it done today. I'll post it if I do.
|
# ¿ Aug 19, 2009 15:35 |
|
SmirkingJack posted:I think I've (almost) got it. I looked at the code for add_submenu_page(), which add_*_page (add_posts_page in my case) calls, and saw a global array called $_registered_pages. In my plugin I added the hookname (from get_plugin_page_hookname($file, 'edit.php')) to that array and I think it worked, but I haven't had a chance to really test it. Add some permissions checking and you should be good. Maybe. Got it finished. It's up to you how you want to do it in a page. main file: http://pastie.org/589009 m/publication.php http://pastie.org/589010 v/publication_form.php http://pastie.org/589012 v/publication_table.php http://pastie.org/589014 Ned: I make assumptions that $wpdb->update and ->insert auto-sanitizes, is that right? (Oh wait I left a couple things finished. Whatever you get the point) NotShadowStar fucked around with this message at 21:47 on Aug 19, 2009 |
# ¿ Aug 19, 2009 21:43 |
|
Actually that page didn't say one or the other, it just said 'here they are'. According to the Data Validation: quote:$wpdb->insert( $table, (array) $data ) So I think it does... I made that assumption because why would you use insert and update if it didn't sanitize?
|
# ¿ Aug 19, 2009 22:10 |
|
You probably want get_categories() which gives you an array of categories, then array_rand().
|
# ¿ Aug 20, 2009 21:24 |
|
Another quick way is to change the permalink structure in the admin panel and save. If you don't get any errors everything should work out. If it says it can't write .htaccess, then you need to change the permissions on your host like Ned linked to.
|
# ¿ Sep 16, 2009 18:38 |
|
Something sounds pretty ridiculous but if you absolutely need to it the way you describe then you need to write a plugin. Wordpress plugins are designed around a series of hooks that allow you to execute your own PHP code when Wordpress hits a particular point in it's processing chain. Unfortunately I never could find a site that has the hooks in some sort of sequential order, so you'll need to find an appropriate hook before WP gets to the template cycle http://codex.wordpress.org/Plugin_API
|
# ¿ Oct 1, 2009 19:25 |
|
Ned would know more about the event chain but if it's too late to do what you're trying to do when Wordpress starts rendering templates files, from codex.wordpress.org: init Runs after WordPress has finished loading but before any headers are sent. Useful for intercepting $_GET or $_POST triggers. So you'll want to hook init with the following as a plugin: php:<? function my_awesome_function() { return 0 }; add_action('init', 'my_awesome_function'); ?>
|
# ¿ Oct 1, 2009 22:39 |
|
It looks like your HTML is very wrong. There's mismatched tags all over and mystyped closings. Whenever I have screwy cross-browser behavior the first thing I do is make it valid. That at least gets you a starting point if it doesn't fix it outright. Interestingly enough I believe that Firefox is more tolerant and guesses more from bad HTML than IE these days, go figure. Note: if you use the dynamic sidebar (doesn't look like it but) your HTML won't completely validate as the WP devs added an HTML attribute in the dynamic sidebar that isn't in the standard yet. NotShadowStar fucked around with this message at 06:11 on Oct 3, 2009 |
# ¿ Oct 3, 2009 06:07 |
|
That is a strange problem. What I'm talking about : http://validator.w3.org/check?uri=h...lidator%2F1.654
|
# ¿ Oct 3, 2009 15:50 |
|
Dude, come on: http://codex.wordpress.org/Function_Reference/get_pages
|
# ¿ Oct 12, 2009 20:16 |
|
I've used something like jQuery Corners, which allows you to specify through selectors what gets rounded. If the browser has native corner rounding it will use that, otherwise fall back to drawing its own corners (for IE)
|
# ¿ Oct 14, 2009 03:35 |
|
supster posted:Real estate listings was simply an example. And if you reread my post I'm not even asking how to do this in Wordpress, but if there is a nice clean way to do it as I'm unhappy with all of the approaches I've taken in the past. You can use the stuff I posted earlier for managing publications on a content-based website as a basis. It adds a control panel in the admin interface, and you need to create a custom page to spit out the content how you want it. Problem being, PHP is kind of a poo poo language and Wordpress doesn't help you much outside of Wordpress database functions, so you end up doing a lot of work.
|
# ¿ Oct 23, 2009 20:06 |
|
You might try a WP backed content site and have a Django-powered listing in a subdomain or sub-uri if you know how, and give your users access to the Django control panel which is really quite awesome. Its two separate systems, but probably a whole lot less work for you.
|
# ¿ Oct 23, 2009 23:13 |
|
I just hit that the other day: http://codex.wordpress.org/Customizing_the_Read_More#Link_Jumps_to_More_or_Top_of_Page
|
# ¿ Nov 12, 2009 19:41 |
|
I never did figure this one out. Is there a more elegant way of linking to an image included in the theme rather thanphp:<? <img src="/wp-content/themes/clownfarts/images/clownbutt.png" alt="effu" /> ?>
|
# ¿ Oct 14, 2010 19:43 |
|
Simple: what's a good AdSense plugin? The ones I'm finding through the plugin manager have okay-ish ratings whatever that's worth. Preferably widget-based so I can just drop a widget to a widget area.
|
# ¿ Nov 1, 2010 21:34 |
|
I've been using Advertising Manager which seems okay. The Analytics plugins I've been used to using had nice interfaces that just needed your Analytics ID and the rest you can control right through the control panel. I'm really new to the whole 'making money on your website through ad traffic' thing. Absolutely everything else I've done before has some sort of internal purpose or a supplement to an existing thing, so this is all really new and weird to me. And impossible to find information on with lots of searches going to site like http://make-money-with-your-google-flaccid-seo.br.info/YOU_WON_A_HOG.cfm
|
# ¿ Nov 2, 2010 20:07 |
|
Working on a site where I'm doing a sub-theme of twentyten. It's 1/2 content (thousands of pages) and 1/2 blog. The sidebar will be the same across the whole site for the most part, but for blog pages I want to show archives, subscription links widgets and all that. The best way I can think of is putting all of the widgets I want to show everywhere in Widget Area 2, and the ones I want in just for post areas in Widget Area 1, then create a sidebar.php that detects if it's a page or a post and displays the widget areas accordingly. That seems more complicated than it should be though, is there a better way?
|
# ¿ Nov 8, 2010 19:30 |
|
|
# ¿ Apr 27, 2024 16:07 |
|
This is more Drupal specific, but Wordpress has a lot of the same challenged and the community is much more active, so I'll ask here. What are some strategies for developing a site with a small team? After WP3 it's not as much as an issue, but before that many of the queries, functions and templates only work by ID. For instance for the longest time if you wanted to have a special page template for a particular page you had to create a page-id.php. So a copy of the DB must be sync'd throughout the project. That's pretty bad for development though. Say one developer does a bunch of stuff on their own, commits a copy of the code and the DB to the repository. Another developer is working independently on a different project but interrelated dependencies. They do work and push it back, but the database could be different. Drupal has more complex problems but if people have ideas on how they dealt with it in Wordpress that could spark some ideas. The php files generally aren't a problem, it's centralizing database information in a way that can be propagated safely. Right now I'm completely at a loss.
|
# ¿ Apr 15, 2011 18:12 |