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

javawpscript on "Redesigning My Search Results"

$
0
0

I have got the Twenty Ten WordPress Theme but I don't want to use the current search design. I have found out if I do a normal search for example cheese (?s=cheese) but if I do (news?s=cheese) then it will search that parent page and child pages. I was wondering if there was anyway to get the search looking like the bbc.co.uk search design. I know that it might need editing in the Theme Editor and that is fine!

PS: I use a Multisite with Only 1 Site.


jjthexer on "Am I hacked?"

$
0
0

Hey everyone, I've recently noticed my site has started to become a complete headache. I've tried optimization after optimization and nothing seems to work. Meaning I've installed one plugin no dice so I uninstall and try another. I'm not continuously building plugins repetitively. My site used to load in about a second or 2. Now its more like 5 or 6. Even my wordpress dashboard takes a very long time to load. Nothing much has changed since when it was last working. I've updated some plugins which might be the case but maybe not?

Is there anyway you guys could point me in the right direction on this?

my site: http://www.simplefix.net funny because its an IT site for computer repair but I'm totally stumped. My google page speed insights shows 86/100 for desktop and 58/100 for mobile. https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fsimplefix.net&tab=mobile

Any ideas?

Thanks!

candasm on "Exploit attack hashed codes included all system files"

$
0
0

Hi,

Our blog crashed some days ago. When i started to check these problems , i realised some strange codes on plugins and system codes also one folder named downloads in main directory which is not supposed to exist.

Main directory download folder list: http://prntscr.com/4gnuxq
Example of strange codes begining on the system php files: http://pastebin.com/R1EsbuTA

We have found several php codes under upload directory. Some examples:
http://pastebin.com/i5g36JFH
http://pastebin.com/BuR8JBbA

After exploit attack happend, We reinstall wordpress with new version and plugins. It seems like working fine now.

This document says to install a plugin for exploit attacks. I installed "Exploit Scanner" plugin.

Is there a another solutions for our blog security?

rocke on "Custom Facebook share button with custom title,url,image in wordpress"

$
0
0

I know there may be many such question in stackoverflow . but i am not getting solution what i want

i am using wordpress. In my all post page there is share button ( **via addthis plugin** ) but what happening is when i click to share on Facebook ( **via addthis plugin** ) its taking all thing perfect i means url,title but images is taken something else.


[demo url]

So i tried to made custom share button which is below the addthis plugin :

Thats : **Custom Share on Facebook page!** but when i click on it nothing happens also my title and link is shown on website : below is code of my custom facebook share :

<?php
        $title = the_title();
        $url= the_permalink();
        $summary=urlencode('Custom message that summarizes what your tab is about,  or just a simple message to tell people to check out your tab.');
        $image= wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),  'single-post-thumbnail' );
      ?>
        <a>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image[0];?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">
        	Custom Share on Facebook page!
        </a>

I have also putted OpenGrap tag in my wordpress header.php between head line

<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="" />
<meta property="og:image" content="<?php echo $image[0]; ?>" />
<meta property="og:video" content="" />
<meta property="og:video:width" content="560" />
<meta property="og:video:height" content="340" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

please let me know what going wrong and where. i need all my post from my website should be share on Facebook and twitter with it title,images( thats **resp post** image not any other image from website which is happening now ) and its description )

Reference Link :how i want

paulcoppock on "How to hide div if featured image caption does not exist?"

$
0
0

I'm using this function to display the caption for featured image:

function the_post_thumbnail_caption() {
 global $post;

 $thumbnail_id    = get_post_thumbnail_id($post->ID);
 $thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));

  if ($thumbnail_image && isset($thumbnail_image[0])) {
   return '<div class="front-caption">'.$thumbnail_image[0]->post_excerpt.'</div>';
  } else {
    return;
  }
}

and I'm using:
the_post_thumbnail_caption();
in the template page to display the caption. I've style the div class "front-caption" with borders. If the caption does not exist it still displays the empty but styled div with borders.

Anyone know how to hide the div if no caption exist?

Thank you in advance.

paraz on "multiple selection by check one checkbox"

$
0
0

i need to write a code so that i can check all the checkboxes in a table list by clicking one checkbox. Just same as we have list of pages or posts with the checkbox at the top <thead> portion to select all the item from the list for some bulk actions..
Can i get help in this ??? Thanks a ton in advance. :)

therebelsociety on "Jetpack Issue"

$
0
0

I'm trying to setup the Jetpack plugin and everytime I try to work it out, I get this error.

Jetpack could not contact WordPress.com: register_http_request_failed.

I want to see how can I correct this issue

lukascech on "pick up XML from a 3rd party server via FTP?"

$
0
0

Hi,

I am building a website for a real estate agent. He wants me to pick up property details from his employer's FTP server in XML format.

I couldn't find any plugins of discussions on this - anyone has any experience / ideas?

Thanks,
Lukas


leonardus on "timeout password protected page wp 3.9.2"

$
0
0

Have you a suggestion for setting timeout in protected password page?
if I change setting in wp-pass or in wp-login, with an update my modify are overwritten...
is there a plugin to do this?

sorry for my english... thank you.

qdinar on "how to make upload working outside wp-admin?"

johnignite on "Redirect to Drugstore Sites"

$
0
0

Our site was also attacked by re-directs to online drugstores (nopillnosteel.com, mediczkkf.ru). We believe this is a Wordpress vulnerability. What can be done to prevent this type of attack?
Thank you.

dnw113 on "I can't log in to my website, I get this error:- syntax error, unexpected '"

laNiwa on "Login/Logout in menu, directed to a custom login page"

$
0
0

I currently have the following function on my site to add a login/logout link to the footer menu:

function add_login_logout_link( $items, $args  ) {
	if( $args->theme_location == 'footer-menu' ) {
	        $loginoutlink = wp_loginout('index.php', false);
	        $items .= '<li class="menu-item">'. $loginoutlink .'</li>';
			return $items;
	    }
	    return $items;
}
add_filter( 'wp_nav_menu_items', 'add_login_logout_link', 10, 2 );

I am using WP-Members, I would actually like the login link to go to the page I have designated as the login (which follows the style of my theme, rather than the default WP look). Is there any way I could modify this to work? I'm at a total loss!

ZeeRuX on "Modified Popular Widget (Elegant Themes)"

$
0
0

So.. Im having a widget from ET that I have changed so it shows random posts. But since I have change they way Im writing in my posts I only want to show posts that are written after 1th January 2013. Can someone pls help me with this. I have been trying for ever to find help for this. I paste my code here. Also, Im not using any boxes or anything like that on the widget, just the code here.

<?php class PopularWidget extends WP_Widget
{
    function PopularWidget(){
		$widget_ops = array('description' => 'Displays Popular Posts');
		$control_ops = array('width' => 400, 'height' => 300);
		parent::WP_Widget(false,$name='ET Popular Widget',$widget_ops,$control_ops);
    }

  /* Displays the Widget in the front-end */
    function widget($args, $instance){
		extract($args);
		$title = apply_filters('widget_title', empty($instance['title']) ? 'Popular This Week' : $instance['title']);
		$postsNum = empty($instance['postsNum']) ? '' : (int) $instance['postsNum'];
		$show_thisweek = isset($instance['thisweek']) ? (bool) $instance['thisweek'] : false;

		echo $before_widget;

		if ( $title )
			echo $before_title . $title . $after_title;

?>

<?php

	$additional_query = $show_thisweek ? '&year=' . date('Y') . '&w=' . date('W') : '';

	query_posts( 'post_type=post&posts_per_page='.$postsNum.'&orderby=rand' . $additional_query ); ?>
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<div class="blog-entry">
			<a>" class="comments"></a>
			<h4 class="title"><a>"><?php the_title(); ?></a></h4>
			<p class="meta-info"><?php the_time('j F Y'); ?></p>
		</div>
	<?php endwhile; endif; wp_reset_query(); ?>

<?php
		echo $after_widget;
	}

  /*Saves the settings. */
    function update($new_instance, $old_instance){
		$instance = $old_instance;
		$instance['title'] = sanitize_text_field($new_instance['title']);
		$instance['postsNum'] = (int) $new_instance['postsNum'];
		$instance['thisweek'] = 0;
		if ( isset($new_instance['thisweek']) ) $instance['thisweek'] = 1;

		return $instance;
	}

  /*Creates the form for the widget in the back-end. */
    function form($instance){
		//Defaults
		$instance = wp_parse_args( (array) $instance, array('title'=>'Popular Posts', 'postsNum'=>'','thisweek'=>false) );

		$title = $instance['title'];
		$postsNum = (int) $instance['postsNum'];

		# Title
		echo '<p><label for="' . $this->get_field_id('title') . '">' . 'Title:' . '</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr( $title ) . '" /></p>';
		# Number of posts
		echo '<p><label for="' . $this->get_field_id('postsNum') . '">' . 'Number of posts:' . '</label><input class="widefat" id="' . $this->get_field_id('postsNum') . '" name="' . $this->get_field_name('postsNum') . '" type="text" value="' . esc_attr( $postsNum ) . '" /></p>';	 ?>
		<input class="checkbox" type="checkbox" <?php checked($instance['thisweek'], 1) ?> id="<?php echo $this->get_field_id('thisweek'); ?>" name="<?php echo $this->get_field_name('thisweek'); ?>" />
		<label for="<?php echo $this->get_field_id('thisweek'); ?>"><?php esc_html_e('Popular this week','Aggregate'); ?></label>
		<?php
	}

}// end AboutMeWidget class

function PopularWidgetInit() {
  register_widget('PopularWidget');
}

add_action('widgets_init', 'PopularWidgetInit');

?>

[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Ajax30 on "Exclude posts in a category from the posts page - HTML5 Blank WordPress Theme"

$
0
0

Hello!

I am using HTML5 Blank WordPress Theme for a to build a WordPress based website. I need to exclude all posts in a category (named "Locations") from the blog posts list.

That is not difficult in a simple, classic theme but, as I said above, I am using the HTML5 Blank theme and I don't know how to perform that task. Can anyone tell me?

Thank you!


MichaelNi on "[Feedback / Questions] Simple Self-Stylable Pop-Up (first plugin)"

$
0
0

I hope I am posting this in the right forum:
I have recently developed my first plugin. Before releasing it (I am well aware that there are many plugins out there that already offer the featuers I have built, still, this is a "learning plugin" before I get onto bigger things), I'd like to hear some feedback, especially about the coding style and coding in general. I also have some general questions concerning plugin development.

You may download it here:
http://askella.de/customer/ssspu/simple-self-stylable-popup.zip

Or the individual files:
http://askella/customer/ssspu/ssspu.php
http://askella/customer/ssspu/ssspu_admin_js.js
http://askella/customer/ssspu/ssspu_js.js
http://askella/customer/ssspu/yes.png
And move them into a plugin folder called "simple-self-stylable-popup".

Now to the outstanding questions I have:
I'm using jQuery on the plugin, for both the front- and backend section. In the beginning, I was checking whether jQuery was already loaded this way:

if(!window.jQuery){
	alert("not loaded");
	echo("test");
	script = document.createElement('script');
	script.type = 'text/javascript';
	script.src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
	script.onload = ssspu_run;
	document.getElementsByTagName("head")[0].appendChild(script);
}
else{
	alert("loaded");
	ssspu_run();
}

I later read about this being bad practice and therefore used these WP functions / hooks:

wp_deregister_script('jquery');
	wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js');
	wp_enqueue_script('jquery');

The first question: Does WP ensure that jQuery is only loaded once?

Obviously, as the plugin is called "self stylable pop-up", I need to load CSS into the frontend. I am not using a hook for this yet, as I can not think of another possibility than to dynamically write some sort of frontend.css into the plugin folder (with the css the user has entered in the backend) and hook this up.

Same goes with the CSS in the admin menu, but I also need a PHP call here:

#ssspu_saved:before{
			position:absolute;
			content:url(<? echo(plugins_url('yes.png', __FILE__)); ?>);
			width:22px;
			height:22px;
			margin-left:-30px;
		}

As I can not use PHP in .css files, it is impossible for me to use the correct hook - or am I overlooking something here?

Exactly the same in Javascript, by the way:

<script type="text/javascript">
        var ssspu_active = "<? echo(get_option('ssspu_activated'));?>";
        var ssspu_outsideclick = "<? echo(get_option('ssspu_outsideclick'));?>";
        var ssspu_firstvisit = "<? echo(get_option('ssspu_firstvisit'));?>";
        var ssspu_fadein = "<? echo(get_option('ssspu_fadein'));?>";
        var ssspu_fadeout = "<? echo(get_option('ssspu_fadeout'));?>";
        var ssspu_delay = "<? echo(get_option('ssspu_delay'));?>";
        var cookiename = ("<? echo(get_bloginfo('wpurl'));?>".replace(/[^A-Z0-9]/ig, '') + "popup");
		ssspu_run();
        </script>

(This version of the plugin will be/is released under GPL2)

Thank you very much for your time, answers and feedback!

igogra on "Compare revisions (custom fields)"

$
0
0

Hi.

I have a site where contributors edit posts. However the data is fed in by contributors as custom fields. Then in the pending revision page the modified custom fields are not displayed, just the modified title and the modified content.

That means even if my contributor has edited the custom fields and submitted the post for revision I can't see them in the pending revision while comparing them.

I've tried with "Custom Field Revision" plugin but it seems that it doesn't work in last versions of WordPress. Do you know any other plugin for comparing custom fields as revision? Or any other solution?

Thanks.

Pcosta88 on "Looking for a comment name stripper"

$
0
0

Hello!

I am a teacher and am using my website as part of my class. I'd like students to post on the site BUT for security/privacy reasons when the comment gets approved (I moderate all comments) the student's name gets stripped out. I would need the student name to display in the moderation queue so I know who gets credit. I understand I can manually block out the name but a plugin would save me much for time.

Does such a plugin exist?

mikeyhoward1977 on "Custom Capability - show plugin menu to these users and admins only"

$
0
0

Hi,
I have created a plugin which has custom menu pages.
The plugin creates two roles upon activation (let's say role 1 and role 2).

role 1 is used for some coding and works fine, WordPress users are assigned this role and the code works correctly.

Where I am struggling is that I would the plugin menu's to only be displayed to Administrators and users who have role 2 assigned to them.

I am running the following from a function called by my activation hook...

add_role( 'role 1', 'Role 1', array( 'read' => true, 'level_0' => true ) );
		add_role( 'role 2', 'role 2', array( 'read' => true, 'level_0' => true ) );
		add_action( 'admin_init', 'f_mdjm_caps');

the function f_mdjm_caps contains the following

function f_mdjm_caps()	{ /* Capabilities */
		$role = get_role( 'role 2' );
		$role->add_cap( 'manage_myplugin' );
	}

I tried adjusting my menu code to be

add_menu_page( 'My Menu', 'My Menu', 'manage_myplugin', 'mdjm-dashboard', 'f_mdjm_admin_dashboard' );

but the menu disappears.

Any help appreciated

Thanks!

ganeshrnet on "Filter out the active widget array list - Wordpress"

$
0
0

I am stuck with something in WordPress. I was looking for the answer for this question everywhere possible but couldn't find what I wanted to know.

I have made a widget in the WordPress admin widget page and I want to use this widget data somewhere else in the website. I used the function $data = get_option('widget_data'); to retrieve the data of the widget. Since WordPress supports multiple instances of a widget, the values are stored in database as an array and the output of the code gave me this array list :

array (size=4)
  2 =>
    array (size=3)
      'title' => string 'Notice 0' (length=14)
      'page_id' => string '9472' (length=4)
      'desc' => string '1' (length=1)
  3 =>
    array (size=3)
      'title' => string 'Notice 1' (length=14)
      'page_id' => string '9594' (length=4)
      'desc' => string '1' (length=1)
  4 =>
    array (size=3)
      'title' => string 'Notice 2' (length=16)
      'page_id' => string '9594' (length=4)
      'desc' => string '1' (length=1)
  '_multiwidget' => int 1

The problem is: When I remove an instance of the widget from the widget holder the data used by that deleted widget is not flushed out and because of this I can't understand whether or not to use the data data from array.

My question is: Is there anyway to understand whether the widget instance is still active or not? As you can see that there is no indication or value to understand which all instances are active at the moment and which are not active. Please guide me..

Warm Regards :)

Viewing all 8245 articles
Browse latest View live




Latest Images