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

greatdanemaniac on "Need help with creating a plugin that import facebook status to wordpress"

$
0
0

Hi!
I'm a complete noob and I know very little about php and especially json. However, I'm looking to create a very basic plugin that's supposed to do this:

  1. Import facebook status (and only status, not links or events etc. Just statuses as a single wordpress post.
  2. The post will then have the post format "status" or "aside" added to it and a specific category and perhaps some default tags.
  3. The post will NOT be publicized with the Jetpack module or sent to any social network with any other plugin. It shall only be published on my blog as a normal blog post.
  4. I want Wordpress to check for new posts and perform the same action at least once per hour and if it finds a status update from Facebook, it will create a new post.
  5. I'd like this to be handled via json if possible unless there's a better way.

So far I've found absolutely no solution to this and all plugins that basically can do this either only offer shortcodes for the whole fb feed or it costs a fortune and I don't wanna spend that much money on this.

Please, help me out with a thourough description of how a basic plugin with this can be made. I have no idea where to start.

Thanks!


Asger22 on ""Add new post" on page?"

$
0
0

Hello

How can I get the fields from "add new post" in admin panel on a page, so users can add a post?

//Asger

kyle_tv on "Need Help with finding my hack!! (Network Solutions has me offline)"

$
0
0

Hello Friends,

I've inherited a very poorly designed/coded website from my predecessor. It was built by a friend of a friend who did not have much experience in development. Our site is frequently offline or suspended by our host, Network Solutions (we are looking for a new host), for issues pertaining to a vulnerable plug-in or PHP that's sending excessive amounts of e-mail.

I'm very green with WordPress and I'm not able to tell which files are capable of sending e-mail, let alone which could be vulnerable.

I was hoping some of you might have some suggestions on where to start looking? Or maybe have some tools I can run my files through, or something... anything...

Thanks.

(PS. our site is tv45.org)

Pawel2014 on "A part of Facebook pixel code is autamagically wrapped by quotation marks"

$
0
0

Hi,

I have inserted Facebook pixel code into <head> section of every page, post, etc. of my web site using a pretty simple function located in functions.php of my child theme.
The function looks like this:

function my_fb_pixel() {
    echo "<script>(function() {
…
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6022646741664', {'value':'0.00','currency':'PLN'}]);
</script>";
echo '<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6022646741664&cd[value]=0.00&cd[currency]=PLN&noscript=1" /></noscript>';
}
add_action('wp_head', 'my_fb_pixel ');

Everything goes to the <head> section as intended, but the part within <noscript> tags is wrapped by quotation marks and this piece of code looks as follows:

<noscript>
“<img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6022646741664&cd[value]=0.00&cd[currency]=PLN&noscript=1" />”
</noscript>

which is incorrect in my opinion. I’d would rather expect getting the code as it was used in echo command. The same happens when Facebook Pixel plugins place the pixel code.

I guess that this part won't be processed correctly by browsers and pixel information will be missing.

Any ideas how to fix it?

developer-varsha on "How to submit cart page of woocommerece using ajax"

$
0
0

Hello friends,

I want to submit cart page using ajax on change value of textbox of product

Amrmhish on "copy function does not work, move files and creat foulder"

$
0
0

Hello
i have a problem ,i have a plugin which will move a file after been uploaded
and put it in a specific folder ,,
i tested the code on a normal page which i created in the root
and it is working fine ,but when it is in the plugin code, it is not working
the code is pretty simple
$file = "./wp-content/uploads/jacket.jpg";
$newfile="./uploads/jacket.jpg";
if(!copy($file, $newfile)) {
error_log("failed to copy $file...");
}
ofcourse i tested the plugin code if it is running ,and i am getting error log in wamp that failed to copy ,,help i am hopeless

BBallProCoach on "Access to Editor"

$
0
0

Dear Support,

I already wrote in a different location in the forum. I am with 1und1 (German host) and I can't seem to get access to the editor. Specifically: I am having a problem with a plugin, wrote the guys from the support but they need full access. I already switched to free mode so I should have access according to 1und1.

Anybody know a solution to that? I would appreciate quick help since I can't continue to work on my page unless I get this thing fixed...

THANKS!
ProCoach

jpolk93 on "Running Mobile Jquery"

$
0
0

Hello,

I have a client's website that is running mals' ecom (not the best solution, but some folks are stubborn.) Mal's uses a series of forms and javascript to collect user input, and calculate prices.

One of these forms can be seen here:

http://barndoors.whitepinecut4u.com/barn-door-kits/aluminium-barn-door-kit/

The problem I have: The form or Jquery will not run in a mobile browser. I have tried a number of different browsers through emulation without success.

At first test, I registered and enqueued the mobile script, from the Google. This threw some of my css off and the Jquery did not execute.

I also tried one of those horrible mobile jquery plugins, which resulted the same effect.

No mobile scripts are currently enqueued.

Any Help would be Most Impressive!!


princessoffinland on "How to remove the small line under picture link, when hovering over"

$
0
0

Hi all,

I have just added social media links to my blog http://www.princessoffinland.com and I noticed that there's a small black line appearing under the first two picture links when hovering over.

Could it be that this has something to do with the padding after the first two pictures?

How can I remove these lines?

See my header.php here:

<?php
/**
 * Template for site header
 * @package themify
 * @since 1.0.0
 */
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>

<meta charset="<?php bloginfo( 'charset' ); ?>">

<title><?php wp_title( '|', true, 'right' ); ?></title>

<?php
/**
 *  Stylesheets and Javascript files are enqueued in theme-functions.php
 */
?>

<!-- wp_header -->
<?php wp_head(); ?>

</head>

<body <?php body_class(); ?>>
<?php themify_base_body_start(); // hook ?>

<div id="pagewrap">

	<div id="headerwrap">

		<?php themify_base_header_before(); // hook ?>
		<header id="header" class="pagewidth">
        <?php themify_base_header_start(); // hook ?>
			<?php echo themify_base_site_title( 'site-logo' ); ?>

			<?php if ( $site_desc = get_bloginfo( 'description' ) ) :
				global $themify_customizer;
				?>
				<h2 id="site-description" class="site-description"><?php echo $themify_customizer->site_description(); ?></h2>
			<?php endif; ?>

			<nav>
				<div id="menu-icon" class="mobile-button"><i class="icon-menu"></i></div>
				<?php
				wp_nav_menu( array(
					'theme_location' => 'main-nav',
					'fallback_cb'    => 'themify_base_default_main_nav',
					'container'      => '',
					'menu_id'        => 'main-nav',
					'menu_class'     => 'main-nav'
				));
				?>
				<!-- /#main-nav -->
			</nav>

		<?php themify_base_header_end(); // hook ?>

		<div class="social-icons">

		<a href="https://twitter.com/prncsoffnlnd" target="_blank">
		<img src="http://princessoffinland.com/wp-content/themes/themify-base-child/twitter12.png" width="25" height="25"/>
		<img style="padding-right:8px"/>
		</a>

		<a href="http://www.pinterest.com/prncsoffnlnd/" target="_blank">
		<img src="http://princessoffinland.com/wp-content/themes/themify-base-child/pinterest11.png" width="25" height="25" />
		<img style="padding-right:8px"/>
		</a>

		<a href="http://www.instagram.com/princessoffinland" target="_blank">
		<img src="http://princessoffinland.com/wp-content/themes/themify-base-child/instagram13.png" width="25" height="25" />
		</a>

	</div>

		</header>
		<!-- /#header -->
        <?php themify_base_header_after(); // hook ?>

	</div>
	<!-- /#headerwrap -->
	</div>
	<div id="body" class="clearfix">
    <?php themify_base_layout_before(); //hook ?>
	</div>

</body>

This is my style.css:

/*
Theme Name: Themify Base Child
Theme URI: http://www.princessoffinland.com/
Description: This is a child theme for Themify Base POF
Author: Lisa Illik
Author URI: http://www.princessoffinland.com/
Template: themify-base
Version: 1.0.0
*/

@import url("../themify-base/style.css");

.social-icons {
	float: right;
	margin-top: -6.75%;

	}

/*Iphone screen*/
/*@media only screen and (min-device-width : 768px) and (max-device-width : 1024px)  {*/
@media only screen and (max-device-width: 480px) {

	.social-icons {
	margin-right: 2.5%;
	margin-top: -12.25%;

	}

}

/*Ipad screen landscape*/
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {

.social-icons{
    float: right;
	margin-top: -6.7%;

	}

}

/*Ipad screen portrait*/
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {

.social-icons{
    float: right;
	margin-top: -7.5%;

	}

}

mflu on "Hyperlinks inserted into blank (primarily) content areas"

$
0
0

Our website, http://www.rpm3solutions.com, has been hacked.....someone inserted a bunch of links to random sites that are active in all pages except home page. Links are seen on mouse-over in blank areas of the screen mostly, but sometimes on a link we had previously established. Site runs on WordPress 4.0.1 and Centos 5.5-XS. Inserted hyperlinks are not obvious when viewing WordPress HTML code. Did run a trial version of "Siteguard", which determined that 2 suspicious files were found....one was Google Analytics (makes me suspicious of Siteguard's value) and a file in a plugin we used.
The Siteguard "suspicious files" findings were:
/wp-content/plugins/si-contact-form/includes/class-fscf-process.php

/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin-menu.php

Have since deleted the plugin ("fast secure contact form") and rebooted server, but problem still remains.

CraigHumphrey on "wp_login not firing after plugin authentication provider"

$
0
0

Hey People,

this is my first foray into WordPress and PHP so paint me with a bullseye and call me flamebait...

My end-goal is to map the Windows Azure Active Directory groups through to the WordPress Groups Module groups.

So yes, I'm running WordPress on Azure (standard create website install) and have a Windows Azure AD tenant that I'm getting users and groups from.

I'm using the great Auth0.com plugin to authenticate the WAAD users and the Groups plugin from itthinx.

I've done some playing around with some code in the footer.php to get things going and it's working fine. But realistically I don't want the group mapping being done on every page, I just needs to be on login.

So I tried adding some code to functions.php with an add_action('wp_login', ...) but as far as I can tell, it's not firing.

I'd appreciate any help, and chances are I've missed something obvious....

Here's what I've added to functions.php:

if(!function_exists('_log')){
  function _log( $message ) {
    if( WP_DEBUG === true ){
      if( is_array( $message ) || is_object( $message ) ){
        error_log( print_r( $message, true ) );
      } else {
        error_log( $message );
      }
    }
  }
}

function craig_Login_Hook() {
	_log ('firing craig_Login_Hook()');
	require_once(ABSPATH . 'wp-includes/pluggable.php' );
	global $currentauth0_user;
	$user_id = get_current_user_id();

	if ($user_id > 0) {

		get_currentauth0userinfo();
		/* grab the Auth0 groups for the current user */
		$auth0Groups = $currentauth0_user->groups;

		/* grab all the WordPress Groups */
		$groups = Groups_Group::get_groups(array ( 'order_by'=>'name') );

/*
 *  Iterate through the Auth0 based groups
 *  If the group starts with our prefix
 *    If a matching one exists in WordPress's Groups module,
 *      if current user is a member
 *        do nothing
 *      else
 *        add user to group
 *   else
 *     ignore, we're only concerned with groups that exist in WordPress Groups
 *  else
 *     ignore, we're only concerned with groups that start with out prefix (helps prevent accidental conflicts)
 */
		foreach ($auth0Groups as $auth0Group) {
			if (substr($auth0Group, 0, 2) == 'CT') {
				if ( $group = Groups_Group::read_by_name( $auth0Group ) ) {
					if (Groups_User_Group::read( $user_id , $group->group_id )) {
						/* user already in group */
						_log('user in group '.$group->name);
					} else {
						/* add user to group */
						_log('add user to group '.$group->name);
						Groups_User_Group::create( array( 'user_id' => $user_id, 'group_id' => $group->group_id ) );
					}
 				} else {
					/* no matching group */
					_log('no matching group '.$group->name);
				}
			} else {
				/* not a prefixed group */
				_log('not a prefix group '.$group->name);
			}
		}

/*  Removal from WordPress Groups
 *  Iterate through the WordPress Groups
 *  If the group starts with our prefix
 *    Is the current user a member of this group
 *      Is this group in the list of Auth0 groups
 *        Do nothing, they're meant to be in that group
 *      else
 *        Remove the current user from the WordPress group
 *    else
 *      Do nothing, they're already not in the group
 *  else
 *      Do nothing, we don't want to mess with WordPress's "standard" groups
 */
		foreach ($groups as $groupG) {
			if (substr($groupG->name, 0, 2) == 'CT') {
				if (Groups_User_Group::read( $user_id , $groupG->group_id )) {
					if (in_array($groupG->name, $auth0Groups)) {
						/* user already in group */
					} else {
						/* user should not be in group */
						Groups_User_Group::delete( $user_id, $groupG->group_id );
					}
				} else {
					/* user isn't in group */				}
			} else {
				/* not a prefixed group */
			}
		}
	}
}

add_action( 'wp_login', 'craig_Login_Hook');

Thanks
Craig

sofuegoproductions on "CSS linked SVG search icon"

$
0
0

I've been trying to make a custom search icon rather than the the ugly square box for my website, and want to do this via an svg that is customizable in the css. I've delved into the PHP but may have bit off more than I can chew trying to insert the SVG reference. The file is slightly different from the default being a premium theme but is close enough where the small differences appear to be inconsequential:

<form method="get" id="searchform" action="<?php echo home_url(); ?>/">
	<input type="text" value="<?php _e('Search','revoke'); ?>" onclick="value=''" name="s" id="s" />
	<input type="subtmit" id="searchsubmit" value="<?php _e('Search','revoke'); ?>" />
</form>

I know that I should be inserting the image in the third line, but replacing it with an SVG with an ID linked to the CSS (maybe still retaining #searchsubmit) while still allowing it's search form functionality is beyond my slightly better than basic understanding of PHP. Anyone know a good solution?

boys93 on "how displays of different categories on the homepage"

winkm89 on "tinyMCE 4: access to elements in an iframe opened with editor.windowManager.open"

$
0
0

Hi,

I'm currently trying to write a custom tinyMCE plugin for WordPress and I have a problem:

I open a new editor window (iframe) with the following code:

editor.windowManager.open( {
    url: 'http://127.0.0.1/wordpress/wp-content/plugins/teachpress/admin/document_manager.php?post_id=1003',
    title: 'teachPress Document Manager',
    id: 'tp_document_manager',
    inline: 1,
    width: 950,
    height: 560,
    buttons: [
    {
        text: 'Insert',
        onclick: function(){
            // How can I access to the values of the checkboxes in the iframe here?
        }
    },
    {
        text: 'Close',
        onclick: 'close'
    }
]
});

In the opened iframe I have some checkboxes:

[...]
<iframe src="http://127.0.0.1/wordpress/wp-content/plugins/teachpress/admin/document_manager.php?post_id=1003" tabindex="-1">
[...]
<form method="post">
<input type="checkbox" name="tp_file_checkbox[]" id="tp_file_checkbox_11" class="tp_file_checkbox" value="11">
<input type="checkbox" name="tp_file_checkbox[]" id="tp_file_checkbox_12" class="tp_file_checkbox" value="12">
[...]
</form>
</iframe>
[...]

And here I have no idea how I can read the values from the checkboxes within the function for the insert button.
I've tried it with:
jQuery(".tp_file_checkbox")
But jQuery does not find any element and unfortunately tinyMCE sets no name or id for the iframe (only for the parent DIV of the iframe).

Has anyone an idea how can I read the values from the checkboxes?

ian0mackenzie on "remove_action on a method: Why didn't this work?"

$
0
0

I hope this is the right place to post this - if not, please just simply direct me to the right place!

I recently came across a plugin that, among other things, added a meta entry to the header. I needed to remove this action. The add_action entry looked like this:

add_action( 'wp_head', array( &$this, 'addMetaData' ) );

"this" is in relation to the class, called Vc_Base.

My initial reaction was to add the following to my functions.php:

function removeAddMetaData() {
	$vc = new Vc_Base();
	remove_action('wp_head', array(&$vc, 'addMetaData'),10000);
}
add_action('init', 'removeAddMetaData', 10000);

This did not work. I also tried changing 10000 to other values.

What DID end up working was this:

function removeAddMetaData() {
	remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
add_action('init', 'removeAddMetaData');

I tracked down visual_composer() and it only has one line:
return vc_manager()->vc();

I tracked down vc_manager()->vc() and, among a few other things, it contains these lines:

$vc = new Vc_Base();
$this->factory['vc'] = $vc;
return $this->factory['vc'];

So, if that's just doing what I did (in a round-about way), why didn't my initial idea work? I'd really appreciate some feedback since I feel I'll understand WordPress/PHP a whole lot more if I can understand this!

Thanks in advance.


timotyh on "jQuery Issues"

$
0
0

I have searched the forums for this and can't seem to find anything that helps.

Basically I have used a plugin called Cube Portfolio, and it isn't working properly as there are 2 jQuery version and there clashing. I can cancel the 1.9.1 version as that is in the header.php, however I can not see where the 1.10.2 version is being called from.

If I delete the first version it breaks a lot of functionality on the homepage, but my portfolio blog works. I need to cancel 1.9.1 working on one page on this website. Is there a bit of code I can put in the head that will just cancel the 1.9.1 version out?

You can find the site here
And the page with the portfolio is here

All help is really appreciated!

missbackpacker420 on "Posts I didn't create are appearing on my site"

$
0
0

I thought I am now problem-free after resolving an issue where changes in my homepage are not carrying over. Voila. There are blog posts I didn't create that are being uploaded on my site directing to a Torrent site. I only learned of it because my husband said it's appearing on my FB feed. Please help.

pcknights22 on "Wordpress replaces x"

$
0
0

Hi I have a major issue
I have a title 3x1 but the wordpress keep changing the x with the multiply x sign (which is smaller and positioned in the mid).
What I need is the simple x x Even if I change it from html view and save it the next time i open the post and update it will change it again.
So right now every time i save the post i have to use x
Is there anyway to permanently deactivate this or replace it?
I have tried the ps-stop auto formatting module but didn't work
Any ideas mostly appreciated.

Martin Stehle on "Hooks for posts list columns also work in custom post types lists?"

$
0
0

I figured out an unexpectable behaviour of posts lists:

For printing out a posts list by /wp-admin/edit.php you can add new columns via the hooks 'manage_posts_columns' and 'manage_posts_custom_columns'.

Assume the post type is not 'post' but a custom post type, e.g. 'portfolio'. So you can print out a list of portfolio posts via /wp-admin/edit.php?post_type=portfolio.

I would expect that the formerly mentioned hooks do not work here, only the hooks for that custom post type 'manage_portfolio_posts_columns' and 'manage_portfolio_posts_custom_columns'.

But it seems that added functions via 'manage_posts_columns' and 'manage_posts_custom_columns' are also working in the portfoliio list.

Why that? And how to let functions only for the posts list no work in the portfolio list ?

onurblank on "Huge database partitioning?"

$
0
0

Hello,

I have a huge WP database about 1.5 GB. Its working normally but i cant backup and restore readly. I think when partition my db it will good to manage db.

I wanna partition my wp_post table on another database. I dont wanna use an Plugin for this. Maybe it can be when wp-config.php editing. How can i do this?

Thanks for helping.
(Sorry about my English)

Viewing all 8245 articles
Browse latest View live




Latest Images