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

Martin027 on "Edit Web Page"

$
0
0

Hi everyone!

I just started using WordPress a few days ago. I heard a lot about it, and that a lot of websites are designed using WordPress, so I thought I'd give it a shot.

I have a website that has a Contact Form on it. The Contact Form was created using the Contact Form 7 plugin. What I want to do is, use PHP to hit the database and insert the record into it. From a PHP standpoint, I know how to do it, but trying to figure out where and how to do it via WordPress is almost a nightmare. It's like everything is intertwined together. I'm used to having a .php page which uses another php page as the "action" and editing it that way.

Is there any way I can accomplish what I am trying to do without exhausting too much effort?

Thanks in advance!
Martin


tomacpace on "When and where is apply_filter called for pre_user_pass?"

$
0
0

(sorry this was posted a few minutes ago in Plugins before finding this Hacks sub forum)

Greetings

The main user base for a new wordpress site is senior citizens, and after a quick user test yesterday, I found there is a huge, tremendous challenge for them to remember or copy down (hand-written in the test yesterday) the long multi-case hash password emailed out when registering.

So I have added:
add_filter("pre_user_pass", "myplugin_filter_pre_user_pass")

and it is not being called. So I have dug through the user.php file and cannot find any path through the wp_insert_user where that filter is applied. FYI, my approach is to not use a hash for the plain-text password, rather a simple noun out of a list of 20 words, appended by a 3-digit number. Kinda weak password, but for the sake of creating a new user for a senior, it would be much more appropriate.

Thoughts? Help? Thanks.

tdundas on "everything has been deleted"

$
0
0

Hi I have no technical skills and have had a couple of 'exeperts' helping me with wordpress. the site was nearly finished on friday but on monday everything had gone.
The guy helping tells me someone has got in a deleted everything.
How can I track who was in or out of the site.. and is there any remedy here re my site?

teesontap on "Plugin doesn't work. Use WooCommerce product image as its category image."

$
0
0

I found this plugin called 'WooCommerce Category Images Modification' by a guy called ashfame but can't get it to work.

This would be very handy for me as I currently have 600 categories and about to add several hundred more.

It's supposed to "Use WooCommerce product image as its category image" so if you don't have a category image set, it borrows a random image from a product in that category and uses that as the category thumbnail. His download link was some crazy tar.gz file so I just zipped the raw php file and installed it that way.

Here is the php file. It would be awesome if somebody could make sense of it and help me out! I am running Kadence Virtue theme if that helps. Thanks in advance.

<?php
/**
 * Plugin Name: WooCommerce Category Images Modification
 * Plugin URI: http://blog.ashfame.com/?p=1117
 * Description: Use product image as its category image on category archive pages (To override image for product category, upload one for that category and it will override)
 * Author: Ashfame
 * Version: 0.1.1
 * Author URI: http://ashfame.com/
 */

class WooCommerce_Category_Images_From_Product {

	private $let_category_image_override = true;
	private $randomize_category_image_from_products = true;

	public function __construct() {
		// Unhooking core's and hooking our custom thumbnail
		add_action( 'plugins_loaded', array( $this, 'overrides' ) );
		add_action( 'woocommerce_before_subcategory_title', array( $this, 'add_product_image_as_woocommerce_subcategory_thumbnail' ) );

		// Support link in plugins listing
		add_filter( 'plugin_action_links', array( $this, 'support_plugin_action_link' ), 10, 2 );
	}

	public function overrides() {
		remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
	}

	public function add_product_image_as_woocommerce_subcategory_thumbnail( $category ) {

		if ( $this->let_category_image_override ) {
			if ( get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true ) ) {
				woocommerce_subcategory_thumbnail( $category );
				return;
			}
		}

		$query_args = array(
			'posts_per_page' => $this->randomize_category_image_from_products ? 10 : 1,
			'post_status' => 'publish',
			'post_type' => 'product',
			'tax_query' => array(
				array(
					'taxonomy' => 'product_cat',
					'field' => 'id',
					'terms' => $category->term_id
				)
			)
		);

		$products = get_posts( $query_args );

		if ( $products ) {
			echo get_the_post_thumbnail( $products[ array_rand( $products ) ]->ID, 'shop_thumbnail' );
		}
	}

	public function support_plugin_action_link( $links, $file ) {
		if ( $file == plugin_basename( __FILE__ ) ) {
			$support_link = '<a href="mailto:mail@ashfame.com?subject=' . rawurlencode('Premium Support') . '">Premium Support</a>';
			array_unshift( $links, $support_link );
		}

		return $links;
	}
}

new WooCommerce_Category_Images_From_Product();

63com on "paragraphs desappear from page"

$
0
0

I can't create paragraphs on page.

The line are allways rebuilt and <p> erease.

For example, when i write :

line 1

line 2

in back-office.

The result in front-office is

line 1 line 2

And if I add <p> in text tab from page, each time I save, <p> desapear too.

Example in back-office text -ab

<p>
line 1
</p>
<p>
line 2
</p>

become after saving, as soon as i clic on visual tab :

line 1

line 2

And

line 1 line 2

in front-office

I have desactived all plugins

What can I do ?

ac1643 on "remove anchor hashtags in the address bar using pure css?"

$
0
0

Hi

Is it possible to not show anchor hashtags in the address bar using pure css?

Or can it be done in html? I can't find much on the internet about this.

I have no experience with javascript, although if the solution is only by using js and is fairly simple to implement (and someone can describe it to me!) then i'll give it a shot.

Like a say, a non-js solution would be ideal

Thanks

wallends on "Confirm Delete button missing"

$
0
0

Hi,
After upgrading WP to 4.0 on my site, I noticed that I have a ton of bot users (9500). So to prevent more bot user registrations, I have disabled registration, until I find a better solution and fix the bigger problem at hand.

The problem that I am facing now is, when I try to delete these bot users, I don't see the final Delete button in the confirmation page. Does not matter if I select a user or multiple users. It goes to the next page, where it gives me choice of what I want to do with the posts from the user I am trying to delete. But there is no final Delete button on that page.

I have already tried to re-install WP 4.0. I have seen another thread open for this same issue without any resolution.
Please help!

Jackangel on "all plugins gone after installing "Spiffy Calendar""

$
0
0

I've had difficulty re-establishing my website after it was badly hacked--it had a porn re-direct for iphones, and nothing was working quite right. Then, after wiping clean, re-installing, and seemingly starting fresh, I could never get the Tempera template to fully operate, nor did any of my plugins operate properly. I managed to get the site to function despite the annoyance and extra time. I hated the Calendar I had installed because it just didn't suit my needs and only one function worked. So, I installed "Spiffy Calendar". All of the sudden, all the other plugins were gone (had about 8 or 9). I'm wondering if I'm going to expect this to happen on a regular basis until I can afford to have my site built for me. This is a time-sucker extraordinaire. I haven't come across anyone else with these problems.


mrina on "Membership database"

$
0
0

Hello people,
I ask if is there plugin for membership store, that you can add member/employee in admin area with there id, names etc. and able to appear in front area with ability to search specific member by id or name.

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.

nepf on "Export Query to csv - fputcsv"

$
0
0

I whould like to export a query with the_title() and some get_post_meta() to a csv-file.
I think fputcsv() is the rigth PHP-function, but i have no idea how to put this into the loop.
Has anyone helpful hints for me?
Thank you.

vahost on "nested shortcodes"

$
0
0

I'm trying to create a second instance of the home page that contains the same content as the actual home page. The actual home page includes some shortcodes, and they fail to convert from the shortcode to the actual replacement content on the second home page.

Here is my function for my shortcode to make the actual home page appear in the second home page:

/* Load home page content into second version of page via shortcode */
// [home2]
function second_home_page( $atts ) {
	$post_8 = get_post(8);
	$content_8 = $post_8->post_content;
	print $content_8;
}
add_shortcode( 'home2', 'second_home_page' );

That worked, except that the shortcodes didn't fire in the second home page. Instead, I simply see entries like [shortcode] in the text of the live page.

So, I tried to add a filter to my function, like this:

/* Load home page content into second version of page via shortcode */
// [home2]
function second_home_page( $atts ) {
	$post_8 = get_post(8);
	$content_8 = $post_8->post_content;
	add_filter( $content_8, 'do_shortcode' ), 11 );
	print $content_8;
}
add_shortcode( 'home2', 'second_home_page' );

However, this results in not only the shortcodes from the actual home page failing to fire on the second home page, but it also prevents other short codes associated with the template from firing as well.

Can someone tell me how to fix this?

Sven de Bie on "Overrule update_post_meta"

$
0
0

I currently have the following code:

add_action('update_post_meta','dbp_wc_price_update_meta',10,4);
function dbp_wc_price_update_meta($meta_id, $post_id, $meta_key, $meta_value){
	if( in_array($meta_key,array('_price','_price_var') ) ){
		$meta_value	= str_replace(',','.',$meta_value);
	}
return $meta_value;
}

I want to make sure that there are no commas in the meta_value before it is saved. But with the hook and function above it is just saved as it is.

When I save 5,95 it still is saved as 5,95, but I want it to be saved as 5.95.

MorbidEntree on "Is There a Plugin Out There That Can Do This?"

$
0
0

I'm running Wordpress version 4.0.

I'm looking for a plugin that would manage a php file that would act as a redirect to the latest post on my site.

Either that, or a plugin that could create a link that would always go to the latest post.

KsvBist on "Attack Issues"

$
0
0

I found that some anonymous user was added to my website where as I don't have added anyone in my site. It was user "Jlhy1101 with email Id jlhy101@hotmail.com"


Pete on "Only post author and commentor can view their own comments"

$
0
0

Only post author and commentor can view their own comments.

How would I do this...
I want the comment's to an author's posts ONLY viewable by the post author and the commentor.

For example the author publishes a post, commentor A posts a comment on the post and the post author post's a reply comment to commentor A. ONLY the post author and commentor A can view their comments. If commentor B does the same then only the post author and commentor B can view their comments.

Thanks
Pete

Drachsi on "Google reports site is hacked, but how can it be?"

$
0
0

I have a site at http://brand-ambassadors.org/ which Google reports as hacked, There is a file I never created which points to a French gaming site.

I have WP 4 installed and limit Plugins.

How can it happen, what can I do to remove it and stopped it happening again?

Hope somebody can help.

Regards
Drachsi

rahendz on "Manual-Excerpt Length"

$
0
0

I developing theme for wordpress and using custom excerpt length, for a while it works. But when i set a manual excerpt on excerpt meta box suddenly my custom excerpt function didn't works.

anyone can help me to solve this issue, thanks before.

leisegang on "Prepend code to the_content via MySQL"

$
0
0

I have a custom field called: _format_video_embed

i want the value of this field that is a youtube link added to the start of the posts that i have. There are over 1400 posts that does not have the video link in the post_content but in the post_meta field called _format_video_embed

Is there a way to add this via MySQL?

Some update command that could work?

SELECT wposts.ID, wposts.post_title, wposts.post_content,wposts.post_type, wpostmeta.*
    FROM wp_posts wposts, wp_postmeta wpostmeta
    WHERE wposts.ID = wpostmeta.post_id
    AND wpostmeta.meta_key LIKE '_format_video_embed'
    AND wposts.post_type = 'post'
    ORDER BY wposts.ID DESC

That selects all the fields i need. Now i need to insert the meta value into the post_content. as the first line.

Can anyone help me with that?

Or some code to add to my functions.php that copies that field?

jim2k on "Show related posts by category"

$
0
0

Is there a simple, plugin-free way of showing a number of related posts from the same category on the single.php page (without showing the current post as part of the list, of course)? Perhaps using wp_query?

I've tried a bunch of things and the tutorials out there are all several years old and don't really work.

Thanks in advance!

Viewing all 8245 articles
Browse latest View live




Latest Images