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

static-blur on "Imported csv file won't update posts using wp_insert_post()"

$
0
0

Hi

Long time lurker here on the forum.
Normally an hour or so searching and I find a solution to my issue, but
this time I've had no luck.

I'm using the code below to upload csv file and import the posts into the custom post type, everything is working except I'm unable to figure out how to get wp_insert_post() to update a published post which shares the same ID.

Instead it just duplicates a new post, I'm using import_id to grab the id from the csv column which works if the id doesn't exist. But updating is where I'm stuck.

Any tips or advice in this area would be much appreciated.

<?php $file = wp_import_handle_upload();

	if(isset($file['file'])) {

		$row = 0;
		if (($handle = fopen($file['file'], "r")) !== FALSE) {
		    while (($data = fgetcsv($handle, 1000, "|")) !== FALSE) {

		    	if($row == 0) {
		    		// Don't do anything with the header row
		    		$row++;
		    		continue;
		    	} else {
		    		$row++;

		// Get the post data
	$postinfo = array (
		'import_id'	=> $data[0],
		'post_type'     => '$post_type',
		'post_title'    => $data[2] .' ('. $data[1].')',
		'post_content' 	=> $data[3],
		'post_status'   => 'publish',
			);

 $newpost = wp_insert_post($postinfo);
}?>

the_circle_pit on "Not found or invalid function error"

$
0
0

Hello,

I just checked my error_log file and found this warning over and over again.. I was hoping someone could explain it and possibility present a fix.

Thank you!

PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'improved_trim_excerpt' not found or invalid function name in /home/thecircl/public_html/wp-includes/plugin.php on line 214

function apply_filters( $tag, $value ) {
global $wp_filter, $merged_filters, $wp_current_filter;

$args = array();

// Do 'all' actions first.
if ( isset($wp_filter['all']) ) {
$wp_current_filter[] = $tag;
$args = func_get_args();
_wp_call_all_hook($args);
}

if ( !isset($wp_filter[$tag]) ) {
if ( isset($wp_filter['all']) )
array_pop($wp_current_filter);
return $value;
}

if ( !isset($wp_filter['all']) )
$wp_current_filter[] = $tag;

// Sort.
if ( !isset( $merged_filters[ $tag ] ) ) {
ksort($wp_filter[$tag]);
$merged_filters[ $tag ] = true;
}

reset( $wp_filter[ $tag ] );

if ( empty($args) )
$args = func_get_args();

do {
foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) ){
$args[1] = $value;
**LINE 214** $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
}
} while ( next($wp_filter[$tag]) !== false );
array_pop( $wp_current_filter );
return $value;
}

360zen on "Two sites use same posts"

$
0
0

Hi there,
My client wants to build two sites that are supposed to share events and blog posts, but contain some separate content (pages, images, etc.). I would like some help figuring out the best way to do this.

After researching this, I have come to the conclusion that Multisite will not solve my problem. I found this solution, but the Automattic plugin referenced is out of date and won't "authorize" properly on my sites running WP 4.0: the solution that doesn't work

What I would really like is to have both sites pull from the same posts and custom-post-type posts. Ideally, they would even be able to share the WordPress core files. The only thing that will be different between them is the theme and certain pages/menus/etc.

Thank you in advance for any help with this. I really appreciate it.

-Justin

parky on "populate database with facebook posts with hash tags"

$
0
0

Im not sure if im in the right place to ask this but what im trying to do is populate a wordpress posts table with facebook posts that have a specific hash tag. I know how to get the return im looking for from facebook but Im not to sure how to integrate into wordpress:
1) is there plugin that i could leverage off
2) should I be looking at making a separate service that does the GET from fb API and try populate the db that way

ANY help would be greatly appreciated and rewarded with the best high five you've ever had

gabrielwolf on "WP just removes the embedded icc profiles. Please, photographers need them!"

$
0
0

Hi core team and other fellows,

I and some other photographers have the problem, that even with the new option to use the ImageMagick engine, the embedded icc profile is striped while generating thumbnails and mid sized images. A embedded profile is now read by FF, Safari and Chrome. I tried the "ImageMagick engine" plugin aswell as the "onet regenerate thumbnails" plugin. Both also remove the profile.

Could someone provide a patch? I tried it myself but got no luck. On the command line it is easy:

(ImageMagick installed manually)

convert 1.jpg 2.jpg will create a new file and keep everything. You can resize and make some stuff, but the profile will be kept.

convert 1.jpg 1.icc will extract the profile

If you have a striped file (no profiles at all) for example
convert 1.jpg -strip 2.jpg and then import your previously extracted icc profile convert 2.jpg -profile 1.icc 3.jpg all is fine.

Core hackers or plugin developers - is this heavy to implement? A imagick PHP module driven patch is good aswell. (and if I could use the imagemagick-sharpen-resized-images plugin that would be super)

Thanks, Gabriel

Shmoo on "Trying to remove with and height attributes off get_avatar"

$
0
0

Just curious why does my filter not work?

// Remove height/width attributes on avatar img tags.
function myscript_remove_dimensions_avatars( $avatar ) {

    $avatar = preg_replace( '/(width|height)=\"\d*\"\s/', "", $avatar );

    return $avatar;

}
add_filter( 'get_avatar', 'myscript_remove_dimensions_avatars', 10 );

SevereMatrex on "My Website is Completely Broken"

$
0
0

So, I have a feeling my website is being hacked.

It started when one day I tried to open the admin dashboard for my website. When I logged in, the entire right side of the screen was white while the right tool bar still remains but it's unclickable. My website was also completely white. It was like this for a few weeks actually. Then, one day, I could not even log in at all.
I would go to the login page but it would not even let me click anything. It seemed like just a screenshot of the login page with my login info there. My website then had writings on it like "Phone adware" "Cell phone malware" and similar things to that all over the page. After a few days my website just turned into a screenshot of my website so I could not click anything. Oddly enough, people were somehow still signing up for my website forums. I'm going to assume they are spam accounts because multiple computers are having the same problem, so its not just me.

I found something strange though, when I go to the wp-login page, it loads for a long time (and crashes after a long wait) and at the bottom right it says "Waiting for m.addthis.com". Turns out that is a plugin that people also have reported adware, malware and issues with.

The thing is, I didn't install that plugin. (dun dun dunnn)

Any help would be appreciated, this seems like a serious problem to me.

My Website: http://operationjunglegame.com/

wallends on "Insert Media - Unable to upload media"

$
0
0

Hi, I am unable to upload new media files to my post via the insert media link. When I do that I get an error - An error has occurred, please try again later.
I have -
1. Checked my Wp-content\2014\ folder to make sure it has wrx permissions
2. Disabled all plugins just in case one of them was causing it.
3. Installed a new 4.0 compatible theme (Responsive theme), and deleted all old themes from FTP. still no luck.

I can upload content via ftp to the wp-content\uploads folder and I can see them in the Media section (list view only - Grid view does not work - I know). But when I go to create a post and insert a media - all I get is a rotating circle and if I try to upload the content again, I get the error.

I am stuck, Please help!


bigswp on "Can set_post_thumbnail be used like this"

$
0
0

I have a folder in:
wp-content/uploads/sites/2/thumbs/ (this is a multisite)
that is being used by a plugin to display images on the front page. I would also like to use these same images as "Featured Images" can I somehow use:
<?php set_post_thumbnail( $post, $thumbnail_id ); ?>
for this purpose?

I should also point out that the images are already using the post id as their name... example: 3301_1.jpg (3301 is the post ID)

It seems to me this would be a lot easier than trying to go in and set all these manually.

emaxads on "Time zone issue"

$
0
0

if i use date function outside wordpress i get correct time
date("F j, Y, g:i a");
November 18, 2014, 9:57 pm
in a word press template i get
November 19, 2014, 3:57 am

Off 6 hours regardless of setting in settings general Time Zone
Is there a place i can set a default timzone in wordpress or any other ideas

Thanks

Dpav on "banner from latest posts?"

$
0
0

hello
I want to create banner with size 300x250 or similar and automatically display inside 4 latest post from certain category. And another sites to display this banner in their sites to advertise our site.
Is there a plugin or code to do this?
thanks

technotrust on "Add meta box on dashboard in specific column"

$
0
0

I'm trying to add a meta box to the dashboard, but I'm wondering if it is possible to specify the column it needs to go. I have the basic 2 column setup which is fine, but all the the meta boxes I add are automatically going in to the first column. Is there a way to add them directly to the second column?

prottos101 on "Subscription period appears 2 times"

$
0
0

Hi guys,
A developer made a website for me and then left and I am stuck. We are using woo commerce subscriptions extension
So in the shopping cart icon is like:

$10 /month/month

It should be one /month only

http://www.shopnchef.com/test/wordpress

I don't know how to upload a photo here so you can see it.
any one can help?
Thank you

jameskzhao on "Add a new php file in the theme folder but don't want the url to be ugly"

$
0
0

I am developing an e-Commerce theme and got stuck on how to add an order page in the theme folder. Sorry if this question sounds silly to you. I am new to wordpress and this is my first project. I have done researches but couldn't figure it out.

I have successfully created customized post type and meta datas, now I have a "buy now" button on the product page to link to another php file in the same theme folder. This php file takes the product id and then calculate the price, redirects user to the payment page after checkout.

But then I realized that the url would look ugly:
http://www.example.com/wp-content/themes/mytheme/order.php?product_id=001

I know I can place the php file in the wordpress root folder, but I am just curious: there are lots of e-Commerce themes, how did they handle this kind of situation?

serauqsng on "Displaying network admin sites table on plugin page?"

$
0
0

Hi,

Essentially, what I am looking to do is have the same table displayed on my network plugin page as the one that is on the sites screen, however, I'm not sure if this is possible in any way, shape or form. Is there a way to do this?


pranata84 on "Help me!!! Cannot delete malware site from footer.php and header.php"

$
0
0

Hello...i need help...my site is hacked and showing pop up window when open the web...i found malware site in the footer.php and header.php, but when i delete it, it return again

growmoney on "Plugins Have Disappeared!"

$
0
0

Can anyone help? I was working on the wordpress blog last night and I did not do anything to the site, the plugins just all deactivated themselves then disappeared. I got a message about the plugins being deactivated because of the header??????
When I try to reinstall the same plugins, it says that the file already exists..it's as though the plugins are still present but not visible and not usable?

Can anyone give me an easy fix? Is this normal? Plugins just deactivate themselves then disappear?

theway2fly on "My website always get hacked"

$
0
0

Dear Support Team,

This is for the second time that my website http://www.theway2fly.com get hacked and now I've just register to wordpress forum therefore appreciate if you could advise us the solution to avoid from Hackers, as I am very tired to redesign again every time our website hacked by unknown person.
FYI I have buy the wordpress theme from D5.

Kindly send email reply to erhan@theway2fly.com

Thank you for your kind & support.

Best regards,

Erhan Al Habshyi

otti.steinhauer on "Edit menu item title"

$
0
0

Hello,

for my new plugin I want to change a menu item title and a page title via code. I am developing a customized login-function and while the user is logged-in the menu item title should change to logout and back after the logout. The same should work with the page title, but there is another possibility: Hide title and create in each case the correct headline in plugin.
How can I change the menu item title?

Thanks

Ottilie

pnilz on "changing password protection wording"

$
0
0

Hey All,

I've got the code in my functions file to change the wording on my password protected page, but I'd like to add some HTML, specifically, a link to another page. When I tried to put this in the code, I got a blank white page. Here's the web page: http://www.wmorris.com/available-work/

Here's the code I'm using:

function my_password_form() {
    global $post;
    $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
    $o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
    ' . __( "For information and assistance acquiring available glass artwork please see the Galleries page to locate a gallery representing William Morris.<br />
Already have a password? Please login below." ) . '
    <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    </form>
    ';
    return $o;
}
add_filter( 'the_password_form', 'my_password_form' );

I'd like to change the text to this:
For information and assistance acquiring glass artwork <a href="/galleries">click here</a> to locate a gallery representing William Morris.
Already have a password? Please login below.

Is this possible? Thanks!

Viewing all 8245 articles
Browse latest View live




Latest Images