Autoptimize admin bar fix released

Bekijk Autoptimize admin bar fix released

Moeilijkheidsniveau: , ,

As we really love the plugin Autoptimize we were troubled by the fact that the admin bar was not showing on front end ..

Therefore we wrote a simple plugin to fix that. Download it here: http://wordpress.org/extend/plugins/autoptimize-admin-bar-fix/


Solution for read more

Bekijk Solution for read more

Moeilijkheidsniveau: ,

Using get_posts and/or setup_postdata($post); ( with a global $post ? )

Not getting the short Read more content when using the_content("Read more"); ? Read more not showing? Read more not working?

Here is the solution: tell WordPress that we want to show excerpt versions of the post by calling:
global $more; $more = 0;


Pagina's enkel voor ingelogde leden

Bekijk Pagina's enkel voor ingelogde leden

Moeilijkheidsniveau: ,

Als je pagina's enkel voor ingelogde leden wil hebben, moet je de template bestanden aanpassen.

Howto:

OPEN
page.php {Bij pagina's (pages)}
single.php {Bij blogberichten (posts)}

FIND

< ?php get_header();

INLINE, FIND

< ?php

AFTER, ADD

$current_user = wp_get_current_user();
if ( 0 == $current_user->ID ) {
header("Location: ". wp_login_url( get_permalink() ));
}

Losse template

Wat je ook kunt doen is deze lege template gebruiken, en aanvullen op basis van je page.php of single.php template.
Zie de bijlage.


Solution for Customize Your Community: Error on the profile page shows backend

Bekijk Solution for Customize Your Community: Error on the profile page shows backend

Moeilijkheidsniveau: ,

I was on the phone with a client recently. She reported that some users of her WordPress website had access to protected custom profile fields.
That was strange behaviour, as I used the Customize Your Community plugin to show the edit/update profile page in the site's layout AND I had coded an if/else to show protected fields.

As this only happened to some users, say 1 out of 20, I dug deeper and stupbled upon this discussion: wordpress.org/support/topic/plugin-customize-your-community-error-on-the-profile-page-shows-backend

The root problem

It turns out that when a user produces an error, say: entering a new password, without entering the very same password (typo) in the confirmation field … the error message is shown using the default wp-admin/profile.php backend url/layout!

Potential solution

Was given by nomatteus over here , yet this is reported (over here) to not work in WordPress 2.8.6 and higher. After some digging it turns out that the $is_profile_page is not acessable.

Solution

Warning: this solution involved editing a core WordPress file: wp-admin/user-edit.php . Editing a core WordPress file is never recommended, as it potentially breaks your installation and has to be re-done every time you update WordPress ( tech note: anyone good with patch files ? Please submit one through the contact form ).

Warning: make a file backup of every file you are about to edit!

Note: Presumption: the code

$current_user->has_cap('edit_posts') === false

handles all requests from users that do not have the authorization to edit posts, so normal subscribed users ('subscribe' role). Feel free to change to whatever you like.


Oude pagina urls herschrijven

Bekijk Oude pagina urls herschrijven

Moeilijkheidsniveau: ,

Net een WordPress site opgezet en gedag gezegd tegen je oude Content Management Systeem (CMS)?
Gefeliciteerd! Dat was een goede keuze 🙂

Het probleem van bestaande pagina's

Maar wat doen we met eventuele oude urls zoals: http://mijnsite.nl/?p=pagina&item=overons en http://mijnsite.nl/?p=pagina&item=contact
Die moeten natuurlijk op de een of andere manier omgeschreven worden naar de nieuwe urls: http://mijnsite.nl/overons en http://mijnsite.nl/contact

Bekijk het hele bericht