Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

brandnucreative on "How to add custom field to wordpress register form"

0
0

I'm using a pre-built registration form for new users to sign up to a website. I want to be able to add two fields to the form so that users can input their first name and last name to the form, and that will then display in the user dashboard in the back-end of the website.

Heres the php code as it stands: I've added the fields to the form, but I'm getting an issue where even though first name and surname are being submitted, they aren't appearing in the user's account in the dashboard.

Thanks,
G

public static function init_fields() {
self::$fields = apply_filters( 'register_form_fields', array(
'creds' => array(
'nicename' => array(
'label' => __( 'Username', 'jobify' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 1
),
'first_name' => array(
'label' => __( 'First Name', 'jobify' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 2
),
'last_name' => array(
'label' => __( 'Surname', 'jobify' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 3
),
'email' => array(
'label' => __( 'Email Address', 'jobify' ),
'type' => 'text',
'required' => true,
'placeholder' => __( 'email@example.com', 'jobify' ),
'priority' => 4
),
'password' => array(
'label' => __( 'Password', 'jobify' ),
'type' => 'password',
'required' => true,
'placeholder' => '',
'priority' => 5
)
),
'info' => array(
'role' => array(
'label' => __( 'About You', 'jobify' ),
'type' => 'select',
'required' => true,
'priority' => 6,
'options' => array(
'none' => __( '—Select—', 'jobify' ),
'employer' => __( 'I'm an employer looking to hire', 'jobify' ),
'candidate' => __( 'I'm a paralegal applying for jobs', 'jobify' )
)
)
)
) );
}


ericsmusic on "Integrating SocialKit php script to Wordpress"

0
0

Hi,

I would like to know if it would be possible to integrate SocialKit which is a php social network script to Wordpress so that the accounts would be synced with those from my Wordpress site.

Thanks

Eric

latro666 on "post-title list and category filter"

0
0

If you don't mind the page reloading then this is pretty easy if you have an understanding of WP_query and a bit of php?

Just:

$args = array('posts_per_page' => -1, 'post_type' => 'page');

if($taxquery != ''){
$args['tax_query'] = $taxquery;
}

$my_query = new WP_Query($args);

while ($my_query->have_posts()) : $my_query->the_post();
the_title();
endwhile;

Will list out all ya posts

Add something like this at the top above that:

if($_GET['catfilt'] != ''){
$taxquery = array('tax_query' => array(array('taxonomy' => 'whatevertaxonomy','field' => 'slug','terms' => $_GET['catfilt'])));
}else{
$taxquery = '';
}

camweb21 on "Custom post categories"

0
0

Hi

I've added a custom post type to my site called 'suppliers' and set up categories within that custom post type by adding the following to funtions.php.

function my_custom_post_supplier() {
  $labels = array(
    'name'               => _x( 'Suppliers', 'post type general name' ),
    'singular_name'      => _x( 'Supplier', 'post type singular name' ),
    'add_new'            => _x( 'Add New', 'book' ),
    'add_new_item'       => __( 'Add new supplier' ),
    'edit_item'          => __( 'Edit suppliers' ),
    'new_item'           => __( 'New supplier' ),
    'all_items'          => __( 'All suppliers' ),
    'view_item'          => __( 'View suppliers' ),
    'search_items'       => __( 'Search suppliers' ),
    'not_found'          => __( 'No suppliers found' ),
    'not_found_in_trash' => __( 'No suppliers found in the Trash' ),
    'parent_item_colon'  => '',
    'menu_name'          => 'Suppliers'
  );
  $args = array(
    'labels'        => $labels,
    'description'   => 'Holds our products and product specific data',
    'public'        => true,
    'menu_position' => 5,
    'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
    'has_archive'   => true,
  );
  register_post_type( 'supplier', $args );
}
add_action( 'init', 'my_custom_post_supplier' );

I've then got it to list all the categories within supplier by adding the following code to a page template.

<?php
$customPostTaxonomies = get_object_taxonomies('supplier');

if(count($customPostTaxonomies) > 0)
{
     foreach($customPostTaxonomies as $supplier)
     {
	     $args = array(
         	  'orderby' => 'name',
	          'show_count' => 0,
        	  'pad_counts' => 0,
	          'hierarchical' => 1,
        	  'taxonomy' => $supplier,
        	  'title_li' => ''
        	);

	     wp_list_categories( $args );
     }
} ?>

When I click one of these links it goes to
http://www.mysite.co.uk/supplier_category/categoryname

With categoryname being the name of the link I just clicked.

When do this using normal posts (not custom) this then works by going to my archive.php page to detect what category was clicked and to display the posts within that category. Using custom posts I just get page not found.

I'm using a bespoke theme which used _me (underscoresme) as a starting point.

ialeman on "Remove Main Menu from one specific page in TwentyFourteen"

0
0

Hello, guys. I want to remove the main menu from one specific page in my blog using TwentyFourteen theme, only the main menu, and only in one page. I'm guessing I need to add something in my child theme style.css.

My site is http://www.kcnox.com and the page I want to modify to is id 601. Can you help me?

Kitt Andersen on "rss feed not showing 5 latest posts"

0
0

Hi

I'm having a problem with the rss feed. It doesn't show the 5 newest posts on the site when I check it in firefox and in mailchimp: ttgnordic.com/category/news/feed

I've switched permalinks to default and back again to postname. I've removed blank lines in php and I've disabled all plugins. Nothing helped and I can't figure it out.

Any good suggestions?

mitdrissia on "help removing stubborn spammy links"

0
0

Hi guys,
i have a problem. Some of my sites were hacked sometime ago and i cleaned some of them.But 3 of them still leave spammy links in google search engine. Google forum could not help me out so i hope someone can help me here.
When you look for site:domainname.com in google search engine you will find links like: domainname.com/?mk=michael-kors-layton-bag-salad-recall

How can i remove or block this?My sites are all virus free, i cant get the spammy links removed through webmaster tools.

I think it has to do with a GET variable.
Any help appreciated.
thank you

Jimjimjaroo on "Changing post layout in Snaps: Removing left hand sidebar"

0
0

So I've been dabbling around and learning as I go in CSS. However, I'm no wizard yet, and I cannot seem to find the section in the Snaps theme to remove the entire left side sidebar, and allow my post text and photos full access to the screen. I've whittled it down by "/*XXX*/" blocking out the tags/categories section in my CSS, but even if I remove the date (which is still there) the text of the post and photos do not 'auto-extend' out to the left.

Ultimately I would like to have the date show along the upper left corner, but then allow for the text and img block to spread out across the page.

Check it out here, and thanks in advance for any and all assistance!


richardschmidt07 on "WP-Insert issues"

0
0

I am using WP-Insert to run ad on our company WordPress site. This is working great, but I need to put 5 ads in one spot. I have 3 ads that rotate at the moment. We are using Jarida as a theme, and I have gone into the themes folder and pulled up the php file that contains the ad. It is currently using a switch case to rotate the ads, but will not show the other two ads that I have included. I am at a loss and request support from the community on this issue. Here is a link:
DS News

Thanks,

Richard Schmidt

lindalunnmiller on "serious hack - political in nature"

0
0

Hi - my clients site has been hacked by what appears to be a political group.

http://www.dancecoquitlam.ca

I tried restoring the website using the FTP file management function in CPANEL and the site came back but was rehacked within a couple of hours.

Is there a plugin or set of code that I can install that will block this kind of attack?

Let me know.

Thanks
-Linda

jimmyfro55 on "Malware, suspended site, WP Essentials"

0
0

Hi
My wordpress site http://www.Jimmyfro.com was suspended because I was either hacked, or my hosting co is hard up for cash, and is shaking me down for $200 to clean and replace the following lines of PHP. I would rather pay for WP Essenials at $3 / mnth than pay them 200.00 I have no clue how to do this, other than seek out line for line at the ftp page, and cut n paste into a PHP cleaner. Any advice? Does WP Essentials come with cleaning, posting, tech support?
I have attached another copy of that infected or malicious files at the bottom of this email.

Sincerely,

Muralidharan V
Support Specialist

====================================================

[hacked code removed - please do not post that here]

virenbohra on "paginate_links not working in latest wordpress 4.1"

0
0

The latest wordpress 4.1 is giving issue regarding paginate_links.

I know where exactly the issue is and i have rectified it

UMBRAsec on "Used WordFence - site not working!"

0
0

Hi,
My website http://www.umbrasec.co.uk was hacked. Some link about steroids was hidden under my title and tagline.
In attempt to get rid of it I used WordFence and deleted detected codes.
Site not working properly now.
How can I fix it?
Would theme update help?

Johnny Bass on "5G Firewall code"

0
0

If I used the 5G Firewall code from perishablepress.com in my WP root htaccess file, would I still need to install the WP Firewall 2 or whatever latest version is available?

Kettercat on "Change the order of appearance?"

0
0

Hey everyone!

I have this page:
http://uv-tlv.com/%D7%94%D7%A8%D7%A9%D7%99%D7%9E%D7%94-%D7%A9%D7%9C%D7%9B%D7%9D/
It shows a list of authors, right now sorted by A-Z. Is there a way I can change it to show by "newly listed"?

Here's the page code:

<?php
/* Template Name: הרשימה שלכם */
get_header();
?>

<div id="content" class="auhtor clearfix row-fluid">
  <div id="main" class="span5 clearfix" role="main">
    <?php get_template_part('module-list-right') ?>
  </div>
  <div class="span7 one-col-center list-left">
    <div class="list_nav">
      <?php wp_nav_menu(array('theme_location' => 'list', 'container' => false)); ?>
    </div>
    <div class="list_wrap">

      <!-- site author list -->
      <div class="mylist clearfix">
        <div id="content" role="main">
        <div class="clearfix">
          <?php

			$number 	= 30;
			$paged 		= (get_query_var('paged')) ? get_query_var('paged') : 1;
			$offset 	= ($paged - 1) * $number;
			$users 		= get_users();
			$query 		= get_users('&role=subscriber&offset='.$offset.'&number='.$number);
			$total_users = count($users);
			$total_query = count($query);
			$total_pages = intval($total_users / $number) + 1;

			foreach($query as $user) { ?>
          <?php
            if(get_user_meta( $user->ID, 'wp-approve-user', true )) {
		$list = types_render_usermeta_field( 'userlist', array( 'user_id' => $user->ID ) );
			if(!!$list) {
				?>
          <article id="post-<?php the_ID(); ?>" class="clearfix list_article" role="article">
            <div class="tape"></div>
            <?php
        // regular expression:
        $matchSrc = "/src=[\"' ]?([^\"' >]+)[\"' ]?[^>]*>/i" ;
        // get the <img src="... from the plugin, via one on various methods explained in the documentation...
        $avatar = get_avatar($user->ID); // for example

        // preg match to extract the src= bit
        preg_match($matchSrc, $avatar, $matches);
        $theImageUrl = $matches[1];
		$theImageUrl = str_replace('.thumbnail', '', $theImageUrl);
       ?>
            <img src="<?php bloginfo('template_url') ?>/timthumb/timthumb.php?w=150&h=150&src=<?php echo $theImageUrl ?>" />
            <?php //userphoto_thumbnail($user->ID); ?>
            <h4 style="display: none"> <a href="<?php echo get_author_posts_url($user->ID) ?>"> <span class="listtitle"><?php echo $user->display_name ?> </span></a> </h4>
          </article>
          <?php
			}
		}
	}

			?></div>

          <?php
				if ($total_users > $total_query) {
					echo '<div id="pagination" class="clearfix pagination">';
					  $current_page = max(1, get_query_var('paged'));
					  echo paginate_links(array(
							'base' => get_pagenum_link(1) . '%_%',
							'format' => 'page/%#%/',
							'current' => $current_page,
							'total' => $total_pages,
							'prev_next'    => true,
							'prev_text'    => '&nbsp;',
							'next_text'    => '&nbsp;',
							'type'         => 'list',
					    ));
					echo '</div>';
				}
			?>
        </div>
      </div>
    </div>
  </div>
  <!-- end #main -->
</div>
<!-- end #content -->

<?php get_footer(); ?>

NemanjaWP on "Plugin for video presentation"

0
0

Does any1 know where to find a plugin(or what is the name of it).I want when some1 open my site,automatically displays a short video presentation(time 10s).

philiprabbett on "Overriding 'Add Media' button to send and edit Gallery in a custom field"

0
0

Hi guys,

I've a chunk of JS that I've put together to try and send the Gallery Shortcode to a custom text input field (which is hidden).

$(document.body).on( 'click', '.insert-media', function( e ) {
		var $this = $(this),
			button = $this.data('editor'),
			gallerysc = $('#'+button).val();

		// Check that the input field contains a shortcode and Open the gallery with the shortcode
		if ( gallerysc !== 'undefined' )
			wp.media.gallery.edit( gallerysc );

		// We take control of the media managers 'insert' function (it only sends the html intended for the editor)
		wp.media.editor.insert = function( html ) {
			$("#dh_gallery").val(html);
			$('#wp-content-gallery-shortcode span').html($('#custom_gallery').val());
		};

		wp.media.editor.open( button );
		return false;
	});

This works to an extent where it allows me to send the Gallery shortcode to the input field, and when I press 'Add Media', it populates with the current gallery imagery. The problem then comes from when I try to update the change, for example, remove a few images.

The wp.media.editor.insert doesn't appear to get called in this instance. Does anybody know the correct way of doing this?

//disable media buttons
add_action('admin_head', 'remove_media_buttons');
function remove_media_buttons() {
	global $post;

	if ( $post->post_type == 'custom' && current_user_can( 'publish_posts' ) ) :
		remove_action( 'media_buttons', 'media_buttons' );
		add_action( 'media_buttons', 'add_new_media_button' );
	endif;
}
function add_new_media_button( $editor_id = 'custom_gallery' ) {
	static $instance = 0;
	$instance++;

	$post = get_post();
	if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )
		$post = $GLOBALS['post_ID'];

	wp_enqueue_media( array(
		'post' => $post
	) );

	$gallery = get_post_meta( $post->ID, '_dh_product_gallery', true ); // product gallery
	$img = '<span class="wp-media-buttons-icon"></span> ';

	$id_attribute = $instance === 1 ? ' id="insert-media-button"' : '';
	printf( '<a href="#"%s class="button insert-media add_media" data-editor="%s" title="%s">%s</a>',
		$id_attribute,
		$editor_id,
		esc_attr__( 'Add Media' ),
		$img . __( 'Add Media' )
	);
	printf( '<span id="wp-content-gallery-shortcode"><input type="hidden" name="custom_gallery" value="%s" id="custom_gallery"><strong>%s </strong><span>%s</span></span>',
		esc_attr( $gallery ),
		__( 'Gallery Shortcode:' ),
		( $gallery ) ? esc_attr( $gallery ) : esc_attr__( 'No Gallery Attached' )
	);
}

digitalcam on "Unauthorized access to my site"

0
0

Over the paste 2 weeks my site has been accessed several times and each time the perpetrators disable my plugins, including the WordFence security plugin.

Each time I've had to restore the entire site with a backup.

Today I looked in my apache logs and noticed the time when my site went down someone from from an Asian IP address logged in using wp-login.php.

I had JUST changed the the username and password but apparently they already had my updated changes.

Can someone give me a clue as to how they are doing this?

I'm afraid to leave my site address here. (you can understand why)

juliereader on "Specify USER_ID range for each ROLE in wordpress"

0
0

Wordpress automatically assigns USER_ID to the new registered USER. I am actually using 'optional content plugin' to show each ID their respective download link on their "WELCOME PAGE" immediately after they become user on my site. The download link for each user is different.

I am looking forward for a solution to assign different "USER_ID range" to different "Wordpress Role"

For e.g. My membership plugin allows the following roles by default:

S2MemberLevel1 (User ID may range from 1000-19999)
s2MemberLevel2 (User ID may range from 20000-29999)
S2MemberLevel3 (User ID may range from 30000-39999)

The first member of "S2memberlevel1' should automatically be assigned ID#1000 and the second member should be assigned ID#1001 and so on. The same should apply for each role based on their "specified ID-range".

This way it will be easy for me to list download links one by one for each role/level.

Your help would be appreciated.

enjoyphoneblog on "Failed login attempts even after changing url"

0
0

Hi everyone,
I'm an admin of http://www.enjoyphoneblog.it and I write here to get help on suspected login attempts on my website.
First of all, I'm a safety maniac and for my website I'm using the Plugin called "iThemes Security" following the various online guides and changing mainly site URL.
For months I never have received a suspect login but from January 31 a user continues to try to login with (of course) different IP, for a total of 20/30 daily login with following ban of the IP.
The login is done with the username "adm1n" (obviously does not match with any user). I tried to change the login URL of the site hoping to solve but after a few hours the Hacker has found the new URL and tried again to login with username "adm1n" (PS: I used a login with a 16-digit alphanumeric characters unfindable).
Now I wonder: How is it possible that the hackers will always find the new URL to login?
The site has no free inscriptions and it is closed for only 15 members.
I tried to do a Virus and Malware scan on the site but nothing was found. How can I fix and take away from the site this Hacker? Thank you all

Viewing all 8245 articles
Browse latest View live




Latest Images