AM77
Forum Replies Created
-
Forum: Plugins
In reply to: [BuddyPress Follow] Text changeNo problem. That gettext_with_context worked. Thanks for your help.
Forum: Plugins
In reply to: [BuddyPress Global Search] Extend Search Results to Commnets & Replies+1
Forum: Plugins
In reply to: [BuddyPress Activity Plus] XSS vulnerability in 1.6.3Hi tempacc1234. Do you know if there is anything we can do to prevent major harm if a plugin has such a vulnerability?
I’ve followed WordPress’s security hardening tips to prevent attacks, and have the Wordfence security plugin, so I’m hoping my site is hardened well enough to prevent attacks through this vulnerability.
Forum: Networking WordPress
In reply to: Help with creating an admin options pageSamuel, thanks so much, got it working.
I’m not very good with with coding, kind of a newbie at it, I got a bit mixed up with thinking
$selected == "style1"
was enqueuing the registered file. But that final bit has made it work.And that
plugins_url( '/css/'.$selected.'.css', (__FILE__) )
is alright because the code is in – plugins/my-styles-plugin/my-styles-plugin.php and gets, for example style1, mysite.com/wp-content/plugins/plugins/my-styles/styles1.cssThis solution is perfect for me, really happy with it, thanks for helping ??
Forum: Networking WordPress
In reply to: Help with creating an admin options page+Samuel Elh
Thanks for your help Samuel. That has got the options to save correctly now ready for when a user selects and saves the option. However, the CSS files aren’t enqueueing, they won’t enqueue on frontend when an option is selected and saved.+jhnpldng
Yeah, if you’re not looking to do a lot of theme changes, you could try something like what Samuel Elh provided me with above rather than creating multiple child themes. This is more ideal for what I’m working on. Let me know if you managed to get that code to work too ??Forum: Plugins
In reply to: [BJ Lazy Load] Is it possible to force an admin option?– Any ideas for a code snippet to go in a mu-plugin file for this ?
Thanks
Forum: Networking WordPress
In reply to: Enqueue files for my multisite setupThanks for your replies. That is interesting, so can I just add a css and javascript directories with js and css files inside them in an mu-plugin, then just add:
function my_scripts_method() { wp_enqueue_script( 'newscript', plugins_url( '/js/my.js' , __FILE__ ), array( 'jquery' ) ); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); //https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script
I assumed plugins_url was just for the plugins directory.
Hi Jeremy, I thought I replied to this a few months ago.
Thanks for this it works.
Forum: Everything else WordPress
In reply to: Is it ok to add Javascript in a php file?Thanks Andrew
Forum: Networking WordPress
In reply to: default headerThanks Konstantinos that worked, I didn’t think of that.
I was trying to find an equivalent for get_template_directory_uri, but I just had to do it like this as you say to get it to work:get_template_directory_uri() . ‘/../../custom-folder/images/header.jpg’
Forum: Networking WordPress
In reply to: Default avatarGreat news, I just discovered how to do it, I’ll leave this here for a reference.
I found these wordpress websites about updating options:
https://codex.www.ads-software.com/WPMU_Functions/update_site_option
https://codex.www.ads-software.com/Option_Referenceand found this:
avatar_default
mystery : (default) Mystery Man
blank : Blank
gravatar_default : Gravatar Logo
identicon : Identicon (Generated)
wavatar : Wavatar (Generated)
monsterid : MonsterID (Generated)So after adding the avatar to the avatar list by doing:
add_filter( 'avatar_defaults', 'custom_avatar' ); function custom_avatar ($avatar_defaults) { $myavatar = ('https://mysite.com/wp-content/mydirectory/image.jpg'); $avatar_defaults[$myavatar] = "New Avatar"; return $avatar_defaults; }
I just added this to set it to main default:
update_option( avatar_default, 'https://mysite.com/wp-content/mydirectory/image.jpg' );
I wanted my own default avatar because I have created all my themes to also have a large avatar in the sidebars, and have designed my own default avatar that is better than the default mystery man.
And the avatar plugin overwrites it too :), I was a little worried that it wouldn’t because I think that update option seems to force the value and stops from changing it.
I also have one more question. Is it possible to add a value to my custom avatar because my value is the image url ‘https://mysite.com/wp-content/mydirectory/image.jpg;?
Forum: Networking WordPress
In reply to: Theme & plugin CSS not updatingYes, I think your css file is caching somewhere. I looked at your hosting and you use siteground? I know they have special caching settings that cache certain files.
Try logging into your cpanel, click on the super cacher icon, and make sure all caches are disabled, then flush all caches, then try again, you can turn the caching back on once you’ve made your css edits.
If that doesn’t work, are you using any caching plugins?
Forum: Networking WordPress
In reply to: Using Themes on Subdomain based NetworkYes, sorry. If you are doing that then it is best to have a child theme.
You can edit the footers by using a child themes. So when you upgrade the parent theme your footer code won’t be lost ??
Forum: Networking WordPress
In reply to: Using Themes on Subdomain based NetworkBy what you have said, you don’t need any child themes, just install parent themes and activate them.
If you are looking to design your own themes by adding custom code to css files and php files to modify the parent theme, then use a child theme for that parent theme.
If you do not wish to design your own themes, you don’t need any child theme.
The point to a child theme is you can modify or add functionality to a parent theme, so when you upgrade the parent theme, all your custom code won’t be lost as it is in the child theme.