Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
the kawaiiest
Dec 22, 2010

Uguuuu ~
I use http://wordpress.org/extend/plugins/youtube-shortcode/

Dead simple and responsive to boot.

Adbot
ADBOT LOVES YOU

Bradzor
Mar 18, 2007
Fwhaa?
By default, WordPress should embed youtube videos using oEmbed - just make sure the link is unformatted and on its own line in the editor. Works with vimeo, youtube, and tons of other providers.

Shadowstar
May 19, 2003

~~~~~~~~~
Yup. No plugin required.

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
I need to extend a fresh WordPress install with the ability to:

1. Allow a user to submit contact information for various people/organizations.
2. View that contact information in list form.
3. Update that contact information.
4. Search that contact information for fields that contain certain strings.
5. Filter that contact information by different attributes.

Is there a particularly WordPress-y way to go about this?

My plan is thus:

1.a. Use Ninja Forms (because it's free: link) to get contact information from a user
1.b. Create a separate table for Contacts.
1.c. Write a plugin to move data from Ninja Forms' table(s) to my separate table after use submission.

2. - 5. Just throw some functions into my plugin to query the database and return the relevant data. I'm a little hazy on how I'll be presenting this to the user, but it seems like making some templates would be the correct way.

Does that sound horrible?

mcsuede
Dec 30, 2003

Anyone who has a continuous smile on his face conceals a toughness that is almost frightening.
-Greta Garbo
Codex: Custom Fields

Advanced Custom Fields plugin

the kawaiiest
Dec 22, 2010

Uguuuu ~

Shadowstar posted:

Yup. No plugin required.

... when did that happen? I've been using the plugin for months... :doh:

cheese eats mouse
Jul 6, 2007

A real Portlander now
Syntax question

code:
<?php
	$pagelist = get_pages('sort_column=menu_order&sort_order=asc&exclude_tree=18&exclude_tree=12&exclude_tree=11&exclude_tree=42)');        
	$pages = array();
        foreach ($pagelist as $page) {
        	$pages[] += $page->ID;
        }
What's the correct way to write this so I dont have to keep doing exclude_tree&exclude_tree?

I tried separating with commas and just writing out array. Also tried &12&11&42.

loving syntax gets me.

Nebulon Gate
Feb 23, 2013

cheese eats mouse posted:

Syntax question

code:
<?php
	$pagelist = get_pages('sort_column=menu_order&sort_order=asc&exclude_tree=18&exclude_tree=12&exclude_tree=11&exclude_tree=42)');        
	$pages = array();
        foreach ($pagelist as $page) {
        	$pages[] += $page->ID;
        }
What's the correct way to write this so I dont have to keep doing exclude_tree&exclude_tree?

I tried separating with commas and just writing out array. Also tried &12&11&42.

loving syntax gets me.

code:
<?php


$arg = array(
	'exclude_tree' => '1,2,3,4,6,7'
)

get_pages($args);

This should work.

Stoph
Mar 19, 2006

Give a hug - save a life.
I see a lot of people still using get_posts, but it seems like WP_Query is the way to go. Being inside a real query loop seems to make plugins and built-in functions work better.

I've just created a separate plugin for my WP_Query enhancements on GitHub as Zesty WP Query Iterator. Basically, I turned WP_Query into a simple iterator. Please let me know what you think. The thing that I like is that you can nest them much easier.


php:
    <?php foreach (new ZWP_Query(array('post_type' => 'page')) as $page) : ?>
        <!-- start using outer title -->
        <h1><?php the_title(); ?></h1>

        <?php
        $surveys = new ZWP_Query(array(
            'post_type' => 'survey',
            'post__in' => get_post_meta($page->ID'surveys'true),
        ));
        foreach ($surveys as $survey) : ?>
            <!-- now using inner permalink, inner title -->
            <a href="<?php the_permalink(); ?>">
                <?php the_title(); ?>
            </a>
        <?php endforeach; ?>

        <!-- back to using outer content -->
        <?php the_content(); ?>

    <?php endforeach; ?>

rugbert
Mar 26, 2003
yea, fuck you
Im in the process of building a very custom theme and Im beginning to work on the post templates, but I dont know which hooks are essential for them.

So like, I've seen (but cant remember where)some themes or code snippets for commenting, and in the snippet the code was something like:

if comments allowed
comment hook

And I know there are a probably a few more for other features that Im not away of like trackbacks right? Does anyone have a good tutorial listing out all the essentials?

Vintersorg
Mar 3, 2004

President of
the Brendan Fraser
Fan Club



Any reason one of the sites im working on is having issue creating new posts that have the same name as ones that were deleted in the past? I can create what is known as new Locations and they display properly.

Basically some companies were deleted back in January, we'll call one of them Company A. The client is trying to re-add them with all the exact same information but they won't show up on the live site. They show up in the backend but any links redirect to some other site.

EDIT: After some fiddling I noticed some weird behaviour. If I change the URL it will load the page up. But the moment I change it back it redirects to another site. Adding my test of "-1" to the end of the url will now ALSO redirect. Only if I change the permanent link again will it load the page up.

Does that make any sense? What the heck is going on there.

Vintersorg fucked around with this message at 19:47 on Mar 11, 2013

MustelaFuro
May 6, 2007

Evolution: Reproduction of the fit enough.
I'm new to Wordpress and website making and I have some questions. I bought a domain name, have a server (the goon one, and got Wordpress installed. I'm completely stuck now.

Is there a way to have wordpress not look like a blog? I'd like to have a homepage that acts as hub for the other pages.

cheese eats mouse
Jul 6, 2007

A real Portlander now

MustelaFuro posted:

I'm new to Wordpress and website making and I have some questions. I bought a domain name, have a server (the goon one, and got Wordpress installed. I'm completely stuck now.

Is there a way to have wordpress not look like a blog? I'd like to have a homepage that acts as hub for the other pages.

Create a page and call it home and create anther page and name it blog. Go under settings into Reading and you can select to have a static front page and a blog separate.

From there you're free to hire me (joking).

kedo
Nov 27, 2007

Vintersorg posted:

Any reason one of the sites im working on is having issue creating new posts that have the same name as ones that were deleted in the past? I can create what is known as new Locations and they display properly.

Basically some companies were deleted back in January, we'll call one of them Company A. The client is trying to re-add them with all the exact same information but they won't show up on the live site. They show up in the backend but any links redirect to some other site.

EDIT: After some fiddling I noticed some weird behaviour. If I change the URL it will load the page up. But the moment I change it back it redirects to another site. Adding my test of "-1" to the end of the url will now ALSO redirect. Only if I change the permanent link again will it load the page up.

Does that make any sense? What the heck is going on there.

That actually sounds very much like their WP install has been hacked, assuming the "other site" is not one to which they intend to redirect. Check the code for large amounts of base64 encoded gibberish. I experienced the same thing with a client's site a few months ago. If this is the case, your best bet is to sanitize their theme, give a hard look at their database to make sure there's nothing in there (I don't remember seeing anything), and do a fresh WP / plugin install.

Otherwise I'd look at your .htaccess to see if there's something funky in there.

kedo fucked around with this message at 14:30 on Mar 13, 2013

cheese eats mouse
Jul 6, 2007

A real Portlander now
NVM.

cheese eats mouse fucked around with this message at 22:06 on Mar 14, 2013

Maniaman
Mar 3, 2006
This is making me want to bash my head into a computer screen. First time I've played with Custom Post Types and Custom Taxonomies, and I seem to be having no luck. I'm sure it's probably something stupid that I'm overlooking.

Everything on the admin panel side works fine. However, when feeding the custom taxonomy to wp_list_categories, it's not returning anything.

Using starter code from the bones Wordpress theme.

php:
<?
function custom_post_example() { 
    // creating (registering) the custom type 
        register_post_type( 'athletic_events', /* ([url]http://codex.wordpress.org/Function_Reference/register_post_type[/url]) */
         // let's now add all the options for this post type
        array('labels' => array(
            'name' => __('Athletics', 'bonestheme'), /* This is the Title of the Group */
            'singular_name' => __('Athletics', 'bonestheme'), /* This is the individual type */
            'all_items' => __('All Athletic Events', 'bonestheme'), /* the all items menu item */
            'add_new' => __('Add New', 'bonestheme'), /* The add new menu item */
            'add_new_item' => __('Add New', 'bonestheme'), /* Add New Display Title */
            'edit' => __( 'Edit', 'bonestheme' ), /* Edit Dialog */
            'edit_item' => __('Edit', 'bonestheme'), /* Edit Display Title */
            'new_item' => __('New Post Type', 'bonestheme'), /* New Display Title */
            'view_item' => __('View Post Type', 'bonestheme'), /* View Display Title */
            'search_items' => __('Search Post Type', 'bonestheme'), /* Search Custom Type Title */ 
            'not_found' =>  __('Nothing found in the Database.', 'bonestheme'), /* This displays if there are no entries yet */ 
            'not_found_in_trash' => __('Nothing found in Trash', 'bonestheme'), /* This displays if there is nothing in the trash */
            'parent_item_colon' => ''
            ), /* end of arrays */
            'description' => __( 'Manages score & details of Athletic Events', 'bonestheme' ), /* Custom Type Description */
            'public' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'show_ui' => true,
            'query_var' => true,
            'menu_position' => 8, /* this is what order you want it to appear in on the left hand side menu */ 
            'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
            'rewrite'    => array( 'slug' => 'athletics', 'with_front' => false ), /* you can specify its url slug */
            'has_archive' => 'athletics', /* you can rename the slug here */
            'capability_type' => 'post',
            'hierarchical' => false,
            /* the next one is important, it tells what's enabled in the post editor */
            'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'revisions', 'sticky')
         ) /* end of options */
    ); /* end of register post type */
    
    // now let's add custom categories (these act like categories)
    register_taxonomy( 'athletic_categories', 
        'athletic_events', /* if you change the name of register_post_type( 'custom_type', then you have to change this */
        array('hierarchical' => true,     /* if this is true, it acts like categories */             
            'labels' => array(
                'name' => __( 'Sports', 'bonestheme' ), /* name of the custom taxonomy */
                'singular_name' => __( 'Sports', 'bonestheme' ), /* single taxonomy name */
                'search_items' =>  __( 'Search Sports', 'bonestheme' ), /* search title for taxomony */
                'all_items' => __( 'All Sports', 'bonestheme' ), /* all title for taxonomies */
                'parent_item' => __( 'Parent Sports', 'bonestheme' ), /* parent title for taxonomy */
                'parent_item_colon' => __( 'Parent Sport:', 'bonestheme' ), /* parent taxonomy title */
                'edit_item' => __( 'Edit Sport', 'bonestheme' ), /* edit custom taxonomy title */
                'update_item' => __( 'Update Sport', 'bonestheme' ), /* update title for taxonomy */
                'add_new_item' => __( 'Add New Sport', 'bonestheme' ), /* add new title for taxonomy */
                'new_item_name' => __( 'New Sport Name', 'bonestheme' ) /* name title for taxonomy */
            ),
            'show_admin_column' => true, 
            'show_ui' => true,
            'query_var' => true,
            'rewrite' => array( 'slug' => 'sports' ),
        )
    );   
    
    /* this adds your post categories to your custom post type */
    register_taxonomy_for_object_type('athletic_categories', 'athletic_events');

} 

    // adding the function to the Wordpress init
    add_action( 'init', 'custom_post_example');
?>
Like I said everything on the admin side is fine. However this:
php:
<?
wp_list_categories(array('taxonomy' => 'athletic_categories'));
?>
Isn't giving me anything.

What am I overlooking?


On another topic, I'm debating between Shopp and WooCommerce for a site. Does anyone have experience with either, or have one they would recommend over the other?

mcsuede
Dec 30, 2003

Anyone who has a continuous smile on his face conceals a toughness that is almost frightening.
-Greta Garbo
I haven't used Shopp but WooCommerce is great and it just had a major version release which significantly improved it. There's also a really good paid plugin ecosystem built around it with solutions for just about everything. Chris Lema's site is a useful resource as well.

Omits-Bagels
Feb 13, 2001
My wordpress site has started acting a bit weird lately. The thumbnails on the homepage are randomly broken. Sometimes they will appear and then they stop working. I can't really see any rhyme or reason for the issue. Any ideas?

https://www.thesavvybackpacker.com

Ned
May 23, 2002

by Hand Knit

Omits-Bagels posted:

My wordpress site has started acting a bit weird lately. The thumbnails on the homepage are randomly broken. Sometimes they will appear and then they stop working. I can't really see any rhyme or reason for the issue. Any ideas?

https://www.thesavvybackpacker.com

Don't use timthumb.php - might as well tell WordPress what size to make your thumbnails and then reference them instead. Timthumb is bad!

Bearnt!
Feb 6, 2004

No onions, no onions
We are finding wp-apps.php and wp-count.php in several of our Wordpress installations and after further searching find the PHP injection script in the theme header/footer files (sometimes the index file, sidebar-header, and sidebar-footer also). The script makes reference to wp-apps.php seen here:

php:
<?php error_reporting(0);include_once $_SERVER['DOCUMENT_ROOT'].'/wp-apps.php';?>
We’ve done research online and it seems to be a common piece of Wordpress malware but so far no one has offered a source or permanent solution for removal. We typically clean the sites by removing the two PHP files and deleting the script from header/footer files. It often times comes back though so not really sure if we're missing a place where the script is hiding or whether the infection is server based. I believe it's coming from some vulnerability in the Wordpress installation because it has happened on fresh installs that are no more than a day old. We have updated our WP and all plugins as a precaution as well as implemented secure passwords for login. Any insight would be appreciated, thanks!

Ned
May 23, 2002

by Hand Knit
Are you using timthumb.php? That is usually how folks get in.

try putting this in your .htaccess
code:
RewriteEngine On
# TimThumb Forbid RFI By Host Name But Allow Internal Requests
RewriteCond %{QUERY_STRING} ^.*(http|https|ftp)(%3A|:)(%2F|/)(%2F|/)(w){0,3}.?(blogger|picasa|blogspot|tsunami|petapolitik|photobucket|imgur|imageshack|wordpress\.com|img\.youtube|tinypic\.com|upload\.wikimedia|kkc|start-thegame).*$ [NC,OR]
RewriteCond %{THE_REQUEST} ^.*(http|https|ftp)(%3A|:)(%2F|/)(%2F|/)(w){0,3}.?(blogger|picasa|blogspot|tsunami|petapolitik|photobucket|imgur|imageshack|wordpress\.com|img\.youtube|tinypic\.com|upload\.wikimedia|kkc|start-thegame).*$ [NC]
RewriteRule .* index.php [F,L]
RewriteCond %{REQUEST_URI} (timthumb\.php|phpthumb\.php|thumb\.php|thumbs\.php) [NC]
RewriteRule . – [S=1]‘

Question Mark Mound
Jun 14, 2006

Tokyo Crystal Mew
Dancing Godzilla
For some reason, one of my plugins that I haven't updated in a while isn't in my Updates page any more. The plugin developer said that nothing should be wrong and that it should be in the list, but I'm about a .1 version behind on it. Is it simple in Wordpress to force an update, or should I just wait until they release their next version and hope it shows up again?

the kawaiiest
Dec 22, 2010

Uguuuu ~

Question Mark Mound posted:

For some reason, one of my plugins that I haven't updated in a while isn't in my Updates page any more. The plugin developer said that nothing should be wrong and that it should be in the list, but I'm about a .1 version behind on it. Is it simple in Wordpress to force an update, or should I just wait until they release their next version and hope it shows up again?
You can always just download the plugin and manually update it.

Question Mark Mound
Jun 14, 2006

Tokyo Crystal Mew
Dancing Godzilla

the kawaiiest posted:

You can always just download the plugin and manually update it.
Utterly terrified of losing any data at all, since this plugin is basically what runs my entire site.

Ned
May 23, 2002

by Hand Knit

Question Mark Mound posted:

Utterly terrified of losing any data at all, since this plugin is basically what runs my entire site.

That shouldn't happen. Plugins shouldn't mess with anything in the directory they are installed in. Everything should end up in the database or in the uploads directory.

Bearnt!
Feb 6, 2004

No onions, no onions

Ned posted:

Are you using timthumb.php? That is usually how folks get in.

try putting this in your .htaccess

No timthumb, really at a lost at this point. The only plugins we use are Contact 7, Google XML Sitemaps, Really Simple Captcha, Wordfence and Wordpress (Yoast) SEO across all sites.

edit: SEO Ultimate is on a few as well

Bearnt! fucked around with this message at 22:08 on Mar 26, 2013

Shadowstar
May 19, 2003

~~~~~~~~~

Question Mark Mound posted:

Utterly terrified of losing any data at all, since this plugin is basically what runs my entire site.

Doing it manually is the exact same thing as auto upgrade. You turn it off, upload the new version, and turn it back on. There's nothing to worry about. Make a backup first if you like.

cheese eats mouse
Jul 6, 2007

A real Portlander now

Question Mark Mound posted:

Utterly terrified of losing any data at all, since this plugin is basically what runs my entire site.

We're in a magically world where you can make a copy and save it and then delete anything that's borked.

Tars Tarkas
Apr 13, 2003

Rock the Mok



A nasty woman, I think you should try is, Jess.


Bearnt! posted:

No timthumb, really at a lost at this point. The only plugins we use are Contact 7, Google XML Sitemaps, Really Simple Captcha, Wordfence and Wordpress (Yoast) SEO across all sites.

edit: SEO Ultimate is on a few as well

Are you on shared hosting?

Also do you have any other things such as a forum? Because that's how my site got hit a few years ago.

Bearnt!
Feb 6, 2004

No onions, no onions

Tars Tarkas posted:

Are you on shared hosting?

Also do you have any other things such as a forum? Because that's how my site got hit a few years ago.

I'm thinking the shared hosting was the culprit in combination with WordPress/Plugins just not being updated over time. We are in the process of migrating everything to a dedicated server because whoever set it up originally had no idea what they were doing and it's just a maze of poo poo. Speaking to our IT guy once we move everything he can write a BASH script to search for that PHP line and also remove the wp-apps.php and wp-count.php from any directory so that will be nice. Thanks dudes.

rayk
May 19, 2009

pirate cat │・ □ ・│ノ
Anyone have a recommendation for a live css editor that works nicely with wordpress?

I used to hand code css with notepad++, but it's quite a clunky setup and would love know if there a way to have a live editor. Really love the new Twenty Thirteen theme and thinking of making a customized version of it.

Cheers!

edit: I went ahead with SublimeText 2 + firebug. Worked out fine, SublimeText 2 is quite awesome.

rayk fucked around with this message at 23:17 on Apr 8, 2013

poshphil
Jun 17, 2005

We're looking to run a competition on our website where users can predict the scores of upcoming football matches, I've been searching around trying to find something that will fit what we want to do but am possibly not going for the correct search terms.

What we're after is something like the plugin here but rather than being sent to another page to login/register, we'd like that to be on the same page so if it's a new member they can register at the same time as entering, or an existing member can enter their login details and submit (or if they're already logged in just submit the form).

I'm not great at the technical stuff so while I can get by I wouldn't even know where to start editing stuff for the plugin above. I've also been looking at competition plugins because all we really need is 10 fields that members can enter a number in and then submit in the way above but still haven't seen anything that allows users to register/login and submit all on the one page.

Does anyone know any plugin that sounds like it might do the job here? Doesn't matter if it's paid or free, just want to know if it's possible relatively easily before we make do with the linked plugin.

Heresiarch
Oct 6, 2005

Literature is not exhaustible, for the sufficient and simple reason that no single book is. A book is not an isolated being: it is a relationship, an axis of innumerable relationships.
Arstechnica: Huge attack on WordPress sites could spawn never-before-seen super botnet

If you're not already using some sort of login limiter, now would be a good time to start.

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

Heresiarch posted:

Arstechnica: Huge attack on WordPress sites could spawn never-before-seen super botnet

If you're not already using some sort of login limiter, now would be a good time to start.

No it wouldn't, the attack is massively distributed a login limiter would either not work or make your admin account inaccessible. You have to stop using the admin user.

fuf
Sep 12, 2004

haha

deimos posted:

You have to stop using the admin user.

What does this mean? Like disable it somehow?

Tars Tarkas
Apr 13, 2003

Rock the Mok



A nasty woman, I think you should try is, Jess.


My login attempts from the botnet have all been for the users "admin" and "sitename" (i.e. sitename being the sitename.com) Delete the admin account if it isn't already, and if you have an account with an identical name as your sitename make sure it has a secure password.

Question Mark Mound
Jun 14, 2006

Tokyo Crystal Mew
Dancing Godzilla
So as long as, during setup, I used a non-standard name for the main admin, I'm probably safe?

Heresiarch
Oct 6, 2005

Literature is not exhaustible, for the sufficient and simple reason that no single book is. A book is not an isolated being: it is a relationship, an axis of innumerable relationships.

deimos posted:

No it wouldn't, the attack is massively distributed a login limiter would either not work or make your admin account inaccessible. You have to stop using the admin user.

Ugh, good point. I shouldn't post advice when I'm tired.

Tars Tarkas
Apr 13, 2003

Rock the Mok



A nasty woman, I think you should try is, Jess.


Question Mark Mound posted:

So as long as, during setup, I used a non-standard name for the main admin, I'm probably safe?

You can also use one of the plugins that let you change the location of the admin login page, the site I have that has the page in a different spot has had no login attempts vs dozens on the other sites. Cloudflare also did something to limit attacks, though I use them and there are still attacks happening.

EDIT: You could probably use two-factor authenticating as well, though I have never tried that so I don't know if it is hard to set up or annoying to use.

Tars Tarkas fucked around with this message at 20:23 on Apr 14, 2013

Adbot
ADBOT LOVES YOU

klem_johansen
Jul 11, 2002

[be my e-friend]
Any recommendations for catalog/e-commerce plug-ins for WordPress? I'm looking into Magneto Go as well as cheaper options like Shopper Press, & Shopp. Any thoughts? As for payment gateways, have you have good or bad experiences with any of them? I've used Authorize.net, and they've been OK.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply