Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] please help me change css in php

  • @quinngoldwin

    Participant

    Hello Buddy Dev team,

    I’m very new to php coding and I’ve been trying very hard to get this to work.

    I’m using wedevs project managment plugin with buddypress integration. There dev team doesn’t have the time to customize the plugin for me at the moment so I’m looking for a quick fix. I feel I’m so close but for some reason I’m not getting it to work.

    I have a “create project” button that I would like to hide for all group memembers accept the Group admin. so I would like it to verify if the user is the group admin and show the “create project link”. But if it is just a group member or user, I would like the “create project link” to be hidden. Only group admins should be allowed to create projects… Here is what I have so far. But its not working. Any help or guidence would be greatly appreciated.

    	<?php if ( BP_Groups_Member::get_is_admin_of( $user_id )) { ?>
    				<style  type="text/css" media="screen">
    				.cpm-projects nav.cpm-new-project a {visibility:visible; }
    				</style>
    				<?php }
    				else { ?>
    				<style  type="text/css" media="screen">
    				.cpm-projects nav.cpm-new-project a {visibility:hidden; }
    				</style>
    			<?php } ?>
    

    Keep in mind that the stylesheet for the plugin has this inside the style sheet.

    .cpm-projects nav.cpm-new-project a {
        background: transparent url("../images/plus.png") no-repeat scroll 50% 50%;
        box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3);
        height: 80px;
        width: 80px;
        display: block;
        border-radius: 3px;
    }

    For some reason its still showing for all members with this code.

    Any help would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @quinngoldwin

    Participant

    ps I’ve tried all of these calls and still nothing

    if ( BP_Groups_Member::get_is_admin_of( $user_id )) {

    if ( ! groups_is_user_admin( $user_id, $group_id ) ) {

    if ( groups_is_user_admin( $user_id, $group_id ) ) {

    if ( groups_is_user_admin( get_current_user_id(), $group_id ) ) {

    @quinngoldwin

    Participant

    Special thanks to Brajesh Singh at Buddy Dev for coming up with a solution!

    change css with php in wordpress / buddypress

    @danbp

    Participant

    Glad you got it from the right forum. Thank you for sharing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] please help me change css in php’ is closed to new replies.
Skip to toolbar