djmiller78
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Subscribers appearing in author archiveClumsy, but I added this function and it at least redirects non authors to welcome page. More elegant solutions welcome…
add_action( 'template_redirect', function() { if ( is_author() ) { // get user id from display name $display_name=get_the_author(); global $wpdb; $user = $wpdb->get_row( $wpdb->prepare( "SELECT
ID
FROM $wpdb->users WHEREdisplay_name
= %s", $display_name ) ); $user_id = $user->ID; // get roles from user ide $user_meta=get_userdata($user_id); $user_roles=$user_meta->roles; $is_auth = in_array(('author'), $user_roles); $is_admin = in_array(('administrator'), $user_roles); $is_editor = in_array(('editor'), $user_roles); $is_contrib = in_array(('contributor'), $user_roles); $is_author = ($is_auth||$is_admin||$is_editor||$is_contrib); echo($is_author); if($is_author) { return; } else { wp_redirect( home_url(), 301); die; } } } );Forum: Developing with WordPress
In reply to: query post category based on page titleAaaand, to get back to the page from the post:
<?php $catArray = get_the_category(); $firstCat = $catArray[0]; $catName = $firstCat->name; ?> <a href="<?php echo site_url(); echo "/"; echo $catName;?>"> <?php echo $catName; echo " page";?> </a>
Forum: Themes and Templates
In reply to: [Twenty Twelve] space between content and footerYes, I found it, thank you. I tried commenting margins and padding out in my child which left the parent theme margin formatting active, had to zero the margin and padding parameters out in the child. Thank you.
Forum: Localhost Installs
In reply to: New local WAMP Machine Error Establishing database connectionBrilliant!
Thank you for enlightening me to that subtle fact that should be obvious!
I don’t know how its working in the old machine, but that’s OK, its
working in the new machine now!Have a great day!
Dave Miller
Forum: Localhost Installs
In reply to: New local WAMP Machine Error Establishing database connectionI’ve tried the raw and generated passwords from the wp_users password
database variable in the wp-config file and neither work. The password
works fine in the old machine / database.I suspect that would generate a password error anyway, not a database connection error.
Other than that, everything looks fine. I appreciate your time and effort Lyle. Let me know if any other ideas come to mind. I may try installing the older version of WAMP, but I’m afraid that would create a new nest of issues with Win 8.1.
Forum: Localhost Installs
In reply to: New local WAMP Machine Error Establishing database connectionYes, W is green and online, and yes I have access to all localhost utilities.
Forum: Localhost Installs
In reply to: New local WAMP Machine Error Establishing database connectionThank you for responding.
I didn’t create a new database user.
I am installing WAMP 2.5, the old installation was WAMP 2.2
I’m also seeing a PHP error log filled up with these warnings:
[15-Feb-2015 11:37:54 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘c:/wamp/bin/php/php5.5.12/ext/php_intl.dll’ – The specified module could not be found.
That subdirectory is in place and so are all the files the log complains about.
Forum: Plugins
In reply to: [Add Link to Facebook] link image not showing in facebookI finally got this working. Had to use “Facebook Open Graph Meta Tags for WordPress” plugin and use the links generated by that in the “Add Link to Facebook” picture setup page. Regular short tags from the library (like https://christianwellnessministries.org/?p=14) wouldn’t work. For some reason featured image selected from the media library on the post page worked, but custom short links wouldn’t.
For a short while I had an image in the post page setting that normally says “No images in the media library for this post”, but then I lost it. Not sure how I got that to work, nor how I lost it.
Despite the pain of getting link images to work, I did try several other facebook plugins and this was the most intuitive and easily configured and easily working for the basic functionality of all of them. I would still recommend this plugin over the others…
Forum: Plugins
In reply to: [Add Link to Facebook] link image not showing in facebookThe URL buried in the fbextenal-a link works in the facebook debugger…
http%3A%2F%2Fchristianwellnessministries.org%2F%3Fp%3D54&cfs=1&upscaleForum: Fixing WordPress
In reply to: 404 Errors With Permalinks Set To %postname%I just fixed this after alot of digging. I’m developing locally at /localhost using WAMP in Windows (I suppose that’s obvious.) Found the answer at How-to-enable-Apache-modules
The problem was (for me) that Apache installs with rewrites disabled so
I had to enable rewrites_module.Scroll down to the windows section of the link and here’s what it says:
“WampServer. This is by far the simplest option. If you have installed WampServer just click on the icon in the task bar, hover over the Apache section in the menu that comes up and then hover over the modules section. You will be presented with a list of modules. Simply click on a module name (rewrite_module) to enable it (or disable it if it is already enabled). A check mark next to a module indicates that it is enabled. WampServer will automatically restart the Apache service after you enable a module.”