Mark Wilkinson
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: visual editor not workingTry using the Web inspector in your browser (e.g. Firefox) to see if there are any errors on the page load.
Often for me this has been a permission problem on some of the files in the wp-admin folder which my host has sorted for me.
Forum: Fixing WordPress
In reply to: Posts in the dashboard in wrong orderSwitching back to the defauly Twenty Fourteen theme is a good debugging step. It will indicate whether the problem is with the theme you are using or not and is one way to narrow down where to look for the problem.
Perhaps take a full backup of files and database just in case first?
Forum: Fixing WordPress
In reply to: Posts in the dashboard in wrong orderDo it still do the same when switched to the default theme (TwentyFourteen)?
Forum: Fixing WordPress
In reply to: Dynamic sidebars for subpagesNot had time to test this but something like the following:
<?php /* check whether this is a child page */ if( $post->post_parent > 0 ) { /* get the post parent id */ $mdw_post_parent_id = $post->post_parent; /* get the post parent slug */ $mdw_slug = basename( get_permalink( $mdw_post_parent_id ) ); /* not a child page - has no parent id */ } else { /* get the post slug */ $mdw_post_slug = basename( get_permalink( $post->ID ) ); } /* load dyamic sidebar using slug */ dynamic_sidebar( 'sidebar_' . $mdw_post_slug ); ?>
Forum: Fixing WordPress
In reply to: Categories? Tags? Meta?To add categories take a look here:
https://codex.www.ads-software.com/Manage_Categories_SubPanel
To add tags you can do that on the Post edit screen in the tags metabox. You can see the tags input box on the right of this screen:
https://codex.www.ads-software.com/images/7/7a/write2.png
Unless your theme specifically indicates that you need to add post meta I wouldn’t worry about it unless you are developing a plugin or theme, but you can find information on them here:
Forum: Fixing WordPress
In reply to: How to call a function with button clickIf your button is in a form then add a hidden form field. When the button is pressed the value of that form field is posted. Have you form post to the same page and then you can check on that page whether the form field has been posted. If it has include your function, if not show the page as normal.
Forum: Fixing WordPress
In reply to: CMS for WPThere are a number of plugins for WordPress that do what you are after. I would start by searching the WordPress Plugin repository for members.
https://www.ads-software.com/plugins/search.php?q=members
I know many speak highly of this plugin:
Forum: Hacks
In reply to: Custom Capability for Custom Post TypeFound the answer eventually thanks for looking at the way other plugins have done this, most notably the Whistles plugin by Justin Tadlock. Below is my solution.
When register the post type with
register_post_type
you can pass capability types like this (for a custom post type named bulletin):'capability_type' => 'bulletin', 'map_meta_cap' => true, 'capabilities' => array( // meta caps (don't assign these to roles) 'edit_post' => 'edit_bulletin', 'read_post' => 'read_bulletin', 'delete_post' => 'delete_bulletin', // primitive/meta caps 'create_posts' => 'create_bulletins', // primitive caps used outside of map_meta_cap() 'edit_posts' => 'edit_bulletins', 'edit_others_posts' => 'manage_bulletins', 'publish_posts' => 'manage_bulletins', 'read_private_posts' => 'read', // primitive caps used inside of map_meta_cap() 'read' => 'read', 'delete_posts' => 'manage_bulletins', 'delete_private_posts' => 'manage_bulletins', 'delete_published_posts' => 'manage_bulletins', 'delete_others_posts' => 'manage_bulletins', 'edit_private_posts' => 'edit_bulletins', 'edit_published_posts' => 'edit_bulletins' ),
Then you need to assign the these capabilities to users on plugin activation (or another appropriate hook) to allow them to use the post type:
function mdw_plugin_activation() { /* Get the administrator role. */ $mdw_role = get_role( 'administrator' ); /* If the administrator role exists, add required capabilities for the plugin. */ if ( !empty( $rhsstf_role ) ) { $mdw_role->add_cap( 'manage_bulletins' ); $mdw_role->add_cap( 'create_bulletins' ); $mdw_role->add_cap( 'edit_bulletins' ); } } register_activation_hook( __FILE__, 'mdw_plugin_activation' );
Forum: Hacks
In reply to: Custom Capability for Custom Post TypeThanks for coming back to me with that and I will take another look at the resource you have outlined. That was in fact the place I started however I could not quite get my head around it. Will take another look.
Thanks for your help.
Forum: Localhost Installs
In reply to: Error establishing database connection!!!Sounds like you just need to change the database connection details in the wp-config.php file on the remote site. They are probably different from your local connection details.
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageThanks Esmi – that would be my next step!!
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageAlso check the error logs with your host – they may give you a clue as to what is causing the error
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageAre you using theme other than one of the defaults – twenty[something]?
Forum: Localhost Installs
In reply to: MAMP Pro 2.2 and live to local problemsSounds like you need to run a search and replace on the database to replace all of the old URLs with the new ones. The script below is great for doing this:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageFirst thing to try is deactivating all plugins and switching to the default theme (twenty[something])