nookeen
Forum Replies Created
-
Forum: Hacks
In reply to: Nav-menus, "Hide" URL option for Custom links?In the first function mentioned, there is a small typo in the code. For wp_nav_menu there is ‘remove_title_attre‘ but it should be like the rest ‘remove_title_attr’.
Also, I am not sure that regular expression is correct. It took my url ‘https://my-website/some-page’ and made it ‘https://my-website/\#\’. If that’s the intent that’s fine, but I thought it would need to be href=”#”. I am not a master of regex so I can only provide a link to Smashing Mag that describes them in detail: https://coding.smashingmagazine.com/2009/06/01/essential-guide-to-regular-expressions-tools-tutorials-and-resources/.
But I believe it should be like this:
preg_replace('/href=\"(.*?)\"/', 'href="#"', $nav );
TIP: I prefer to use ‘javascript:void(0);’ to prevent any respond from a click.
So the code I used is:
function remove_title_attr( $nav ) { return $nav = preg_replace('/href=\"http:\/\/nolink\"/', 'href="javascript:void(0);"', $nav ); } add_filter( 'wp_nav_menu', 'remove_title_attr' ); add_filter( 'wp_page_menu', 'remove_title_attr' );
Where I simply put ‘nolink’ into a Custom URL in WordPress and it shows as href=”https://nolink” which is replaced by regular expression and transformed into href=”javascript:void(0);”.
WILL NOT WORK FOR CATEGORY LINKS THOUGH.mYrAn – I know you’re looking to remove the link completely in your Admin side, but I cannot help you with that at the moment.
Forum: Installing WordPress
In reply to: Upgraded to PHP 5.3.0 on Mac now no database connection.Are you referring to problem in /usr/sbin/apachectl? If so, then this is the file. It doesn’t have an extension, but it’s an actual file.
Forum: Installing WordPress
In reply to: Upgraded to PHP 5.3.0 on Mac now no database connection.The first Apache error can be easily fixed.
Download TextWrangler from here https://www.barebones.com/products/textwrangler/ if you don’t have a good text editor.
File>Open, check ‘Show Hidden files’, choose ‘View All’ from drop down and then go to /usr/sbin/apachectl and open it.
Go to line 73, you should see something like this:
if [ “x$ULIMIT_MAX_FILES” != “x” ] ; then
$ULIMIT_MAX_FILES
fiComment it out -> change to:
#if [ “x$ULIMIT_MAX_FILES” != “x” ] ; then
#$ULIMIT_MAX_FILES
#fiIt should do it. Sorry, can’t help you with the PHP at the moment.
FYI: Also, I noticed that Apple Updates deleted my account details here: /private/etc/apache2/users/ <- this directory should have your user name file e.g. ‘myusername.conf’ with the following code:
<Directory “/Users/myusername/Sites/”>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>If it’s not there simply create it.
Hope it helps!
Forum: Hacks
In reply to: Drop-down menu with short description like: (a)text1(br)(span)text2(/span)(/a)'Well, just in case someone was wondering I was able to find this: https://www.ultimateidx.com/menu-manager/ and https://www.catswhocode.com/blog/wordpress-magazine-style-horizontal-dropdown-menu
Nookeen (https://nookeen.com)