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

George88 on "Make custom class available everywhere?"

$
0
0

Hello,

I have written a class and saved it in its own file inside my theme folder (using the BlankSlate theme). I want to include the class in such a way that it is available in every single file for the theme (such as "sidebar.php", "header.php", etc), but using "require_once()" inside the "index.php" file does not work.

How do I do this?

Currently I have used the "require_once()" function in "header.php", but when I want to reference a member function inside the "sidebar.php" file I get an error telling me I'm calling a member function of a non-object. In other words the class is not available inside the "sidebar.php" file.

How can I achieve this?

George


aprillia99 on "Antivirus found these threats.."

$
0
0
/themes/Webly/epanel/custom_functions.php
There is no virusif ( is_file( $file ) ) $thumbnail = str_replace( ABSPATH, t ...

There is no virus$theme_response = unserialize( wp_remote_retrieve_body( $theme_request ) ) ...

/themes/Webly/epanel/import_settings.php/themes/Webly/epanel/options_webly.php/themes/Webly/epanel/post_thumbnails_webly.php/themes/Webly/footer.php/themes/Webly/functions.php/themes/Webly/header.php/themes/Webly/home.php/themes/Webly/includes/additional_functions.php
There is no virus$temp_array = maybe_unserialize(get_post_meta(get_the_ID(),'et_webly_setting ...

There is no virus... ebly_settings", true ) ) $temp_array = maybe_unserialize( get_post_meta( $post_id, "et_webly_settings ...

/themes/Webly/includes/breadcrumbs.php/themes/Webly/includes/entry.php/themes/Webly/includes/featured.php
There is no virus$et_webly_settings = maybe_unserialize( get_post_meta($post->ID,'et_webly_settings' ...

/themes/Webly/includes/navigation.php/themes/Webly/includes/no-results.php/themes/Webly/includes/postinfo.php/themes/Webly/includes/scripts.php/themes/Webly/includes/top_info.php/themes/Webly/includes/widgets.php/themes/Webly/index.php/themes/Webly/page-blog.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-contact.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-full.php/themes/Webly/page-gallery.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-login.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-search.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-sitemap.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

/themes/Webly/page-template-portfolio.php
There is no virus$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_setti ...

is this just a false positive?

MrJP on "I am confused"

$
0
0

When I go to a site, i see it looks hacked with Cialis ads. If I use another computer the site is fine. If I use chrome it is fine. Only on my computer using Internet explorer...on another computer using explorer it is ok too..so it seems I have a virus....but is it me or is it the site itself. when I see the hacked site, I see a WordPress edit heading that seems to be authentic. if I click on anything inthe headign it takes me to a wordpress log in.

Is it my PC that is infected or the web site itself?

alanchrishughes on "Does Wordpress Block HTML 5 Video?"

$
0
0

I've been trying to make this extremely basic page template for videos

<?php get_header(); ?>

<video width="1280" height="720" controls>

<source src="<?php echo get_post_meta($post->ID, 'webm', true); ?>" type="video/webm">

<source src="<?php echo get_post_meta($post->ID, 'mp4', true); ?>" type="video/mp4">

</video> 

<?php get_footer(); ?>

But it wasn't working. I thought maybe it was a problem in the way I was calling for the custom field entry for the videos urls, but even when you directly code the url's, you get an error saying "No video with supported MIME type found."

The code works fine a basic html page, so I assume it must be a problem with Wordpress? Anybody know how to fix it?

youngd2632 on "problem viewing my blog"

$
0
0

whenever anyone tries to log into my blog http://onyekablog.net/ they have problem viewing it. there is always another theme which says "mobile theme" (which displays both on pc and mobile devices) and it displays some weird stuff the screen. it does not say error or anything like that. it happened once and after a while went back to normal and it is happening again. as an admin i have no problem viewing the site but everyone else does.
please is there a solution to this problem?

PetriA on "wp_write_post() doesn't get called"

$
0
0

Hi, I'm trying to create new thread in my forum (SMF) when user creates new post in wordpress. I found this thread where someone shows how it's done.

So I tried to create new thread to my forum in wp-admin\includes\post.php wp_write_post()-function but looks like it never gets called. When I create new post in WP, it actually calls edit_post()-in that file. I've never used (or coded) wordpress before so that's why is this happening?

Dave Minarik on "Search Engines Redirect to Spam Sites"

$
0
0

Hello,

I recently found out that the search engine links that are supposed to go to my site will redirect the user to a spam site. If the site address is typed into the browser, everything is fine.

The site is mercerjunction.com A search for Mercer Junction is where I encounter the problem.

Can anybody offer any tips to correct this?

Thank you,

Dave

tunescool on "Move Button In Posting Page And Add Return Function"

$
0
0

i use this to add a button in my posting page

// add more buttons to the html editor
function wptit_add_quicktags() {
?>
    <script type="text/javascript">
    QTags.addButton( 'wptit_pre', 'Gallery', '<a href="http://url.com" target="_blank">See The Full Gallery Here</a>', '', 'g', 'See The Full Gallery tag', 1 );
    </script>
<?php
}
add_action( 'admin_print_footer_scripts', 'wptit_add_quicktags' );

someone helped me on another forum but didnt do everything i wanted

i want the button the last button, all the way on the rite, its the first button now

i want the button when hit to add the return key, as if the return has been hit and then this html

See The Full Gallery Here

if i have the cursor after the g's, highlite the rest, and hit the button

gggggggggggggggghhhhhhhhhhhhhhhhh

this is what the button does

gggggggggggggggg
See The Full Gallery Here

return and it goes to a new line and the html is added


najwan on "xx.php in my public_html"

$
0
0

hi every one is that possible some one hack word press and put php file in my public_html directory my server administrator send this list I have a sub domain thanks before hand.
The following files and directories have been disabled:
###############################
./public_html/en/cpanelnew1.php
./public_html/en/user.pl
./public_html/en/2
./public_html/en/hat
./public_html/en/hat/.htaccess
./public_html/en/hat/cgi.h4
./public_html/en/5.php
./public_html/en/xx.php
./public_html/en/xxi.php
./public_html/en/1
./public_html/en/1/image.gif
./public_html/en/1/IraQ.gif
./public_html/en/c1d.php
./public_html/ihf2_files/xx.php
./public_html/test2/cpanelnew1.php
###############################

darshakparmar on "Get available image sizes using attachment id"

$
0
0

I have been trying to write a function that adds links to available image sizes below each inserted image in a post.

I know there is a function get_intermediate_image_sizes but it works only within a Loop for attachment pages.

I need a function that allows me to fetch available image sizes using image id as argument. Can anyone suggest a way out?

douglasrhiner on "Multisite Network master tables"

$
0
0

I'm working with a Multisite Network and would like to hear any suggestions on how to tackle this puzzle.

Parameters:
All posts are posted, edited and queried-from one central table, the original, base wp_posts table.
The posts that site wants to display is chosen from a check-box selectable list in the dashboard of each site.
There is a master Theme that all sites will use(GeoTheme).
There will be some "options" that will be exclusive to each site.

The main thing here is to have the posts(which in GeoTheme are lisings): post, edit and query from that one master table, regardless of what site the action may be coming from.

I have figured out the Dashobard list / selector with relative ease.
I've done some serious digging into GeoTheme's guts to see if there is an easy way around things...ha!
I've thought about editing a version of the WPDB class to fit my needs.

If anyone has any experience with this or has some theories on how to do this, please chime in.

Jean_BAB on "Problems with functions.php child file"

$
0
0

Hi everyone,

I'm using a child theme to work with my Explorable wordpress theme (by Elegant Themes).
I tried to create a functions.php file and add some lines:

* To modify a bit my YARPP plugin
* To modify my user profil page by adding three fields:
- Twitter
- Linkedin
- Public email

My codes are working pretty well when I'm testing it with Wampserver. But when I put my code on the internet, I get this message for the Yarpp line:

Fatal Error : Call to unidentified function phpadd_image_size() in /homez.744/moi/www/wp-content/themes/Explorable-child/functions.php on line 1

and my fields won't appear on my user profil page, so I couldn't fill them (pretty logic...) !!!!! *mad*

My functions.php file:

<?php

add_image_size( 'yarpp-thumbnail', 110, 110, true ); // Définir la largeur puis la hauteur des thumbnails de YARPP

/*
#### Big thanks Aky Joe for its tut! ####
Email: akyjoe@thecreatology.com
Edit Custom Author Fields
*/

function extend_author_profile_twit( $twitfields )
{
$twitfields['twitter'] = 'Twitter';
return $twitfields;
}
add_filter('user_contactmethods','extend_author_profile_twit',10,1);

function extend_author_profile_linkin( $linkinfields )
{
$linkinfields['linkedin'] = 'LinkedIn';
return $linkinfields;
}
add_filter('user_contactmethods','extend_author_profile_linkin',10,1);

function extend_author_profile_publicmail( $publicmailfields )
{
$publicmailfields['publicmail'] = 'Mail <em>(public)</em>';
return $publicmailfields;
}
add_filter('user_contactmethods','extend_author_profile_publicmail',10,1);

?>

Could some one help me please?

Thanks a lot,

Jean.

Sujay Pawar on "WordPress Theme Customizer - Hide child option when parent option isn't selected"

$
0
0

Quickly -

I'm trying to figure out "How to hide child options when parent option isn't selected. (in WordPress customizer)

______________

More Details -

There are few bullet points (Parent Options); each might have several child options under it.

Right now what happens is all parents and child options are visible by default when I create a new custom control.

Ex -

# Bullet 1
1
2
3
# Bullet 2 (selected)
I
II
III
# Bullet 3
i
ii
iii

______________

And what I want to do is similar to what happens in default "Static Front Page" customizer setting - The child options should be visible ONLY of the selected parent option.

Ex -

# Bullet 1
# Bullet 2 (selected)
I
II
III
# Bullet 3

______________

Video -

http://www.youtube.com/watch?v=lT_yw2b4KCM

(Video is taken from http://www.yourdomain.com/wp-admin/customize.php - In WordPress Dashboard, Under Appearance -> Themes -> Customize)

Any help would be greatly appreciated.

monkeybrain on "This function stopped working with 3.6"

$
0
0

Hi everybody

I had this custom functions in my functions.php for a while now, it replaces the [...] at the end of an excerpt with a permalink. Unfortunately this stopped working with WP 3.6, does anyone have an idea why and how to fix it?

function replace_excerpt($content) {
       return str_replace('[...]',
               '<p class="more-link"><a href="'. get_permalink() .'">Continue Reading</a></p>',
               $content
       );
}
add_filter('the_excerpt', 'replace_excerpt');

Thanks alot!

AMEEKER on "How to ask for a plugin update?"

$
0
0

This plugin is fantastic: http://wordpress.org/plugins/wp-veriteco-timeline/ and works great. It creates a custom post type to add items to this Timeline http://timeline.verite.co/ rather than using the Google Docs like the original timeline at that site. And it totally works.

The http://timeline.verite.co/ version has been updated to be responsive. The plugin hasn't yet, and it doesn't seem like the plugin author is around anymore. He's not answering support post and his own website is down.

All of the code for the http://timeline.verite.co/ project is on GitHub. I've tried to update it myself in my own install, but let's just say it didn't go as well as I'd like. Is there a way to ask publicly if anyone wants to adopt this and merge the current plugin's functionality with the CSS and media queries from the current repo on Git?

It could also use an option to choose how many posts are displayed in the timeline, rather than using the # set in the general settings for posts.


Eruheran on "Calling php function after an ajax call"

$
0
0

Hey Community!

This is my first issue I try to explain here.
So first of all I have a well workin ajax call, which insert some data in my mysql. After that, I want to call another php function/or echo anything. So what I tried is to call this secound php function over add_action or simplier just by calling the function itselfe. But no result. I only get my echo of the function, when I alert the response of my ajax. So what do I wrong?

Thanks in advance. :)

agasenko on "IDX PYTHON XML-RPC Setup Please HELP"

$
0
0

Hello,

I hoping this is supper easy and someone can help me out :). Im trying to setup TREB IDX on my WordPress website, and I cant figure out how to set this up. This is what I'm following.

The guide says "The configuration file should be located in ~/.treb_wordpress". So I should make a treb_wordpress folder in the root directory and put all the files I downloaded in that folder?

It also says I need to "4. RUN THE SCRIPT" how do I go about running the script in wordpress?

Any help would be much appreciated!

sakuduku on "How to show next 5 link posts from current article?"

$
0
0

by default, wordpress show only one next / previous link on single post. is it possible to show next 5 link posts / prev 5 link posts?

i have searched the php code since yesterday and havent find the code.

thank for advance

jflayhart on "How To Properly Generate and Update Metadata Image Information In WordPress"

$
0
0

I am using a plugin to extract EXIF image data from images uploaded using a form on my wordpress site. As of now it properly uploads and inserts the image into the media library, but I dont think it is generating any metadata information and updating it. I know this because it used to work with another method I was using, but after I upgraded some plugins, it all stopped working and I can't seem to fix it... What is wrong below that might not be allowing the metadata info to generate from the uploaded image? I get this error when viewing the attachment page:

Notice: Undefined variable: metadata in /mnt/soco-app/forms/wp-content/themes/twentytwelve/image.php on line 25

//Add uploaded image to media library
add_action("gform_after_submission", "post_submission", 10, 2);

function post_submission($entry) {

    if($_FILES['input_5']) {/**TURN WP_DEBUG OFF WHEN FIXED**/

        $filename = $entry[5];
        $wp_filetype = wp_check_filetype(basename($filename), null );
        $wp_upload_dir = wp_upload_dir();
        $attachment = array(
            'guid' => $wp_upload_dir['url'] . '/' . basename( $filename ),
            'post_mime_type' => $wp_filetype['type'],
            'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
            'post_content' => '',
            'post_status' => 'inherit'
        );

        $parent_post_id = 9; //ID of Parent Page

        $attach_id = wp_insert_attachment( $attachment, $filename, $parent_post_id );

        require_once(ABSPATH . 'wp-admin/includes/image.php');

        $attach_data = wp_generate_attachment_metadata( $attach_id, $filename   );

        //require_once(ABSPATH . 'wp-includes/post.php');
        //update_post_meta( $parent_post_id, '_wp_attachment_metadata', $attach_data );
        wp_update_attachment_metadata( $attach_id,  $attach_data );
    }
}

Curtiss Grymala on "Updated Role Caps, But User Still Can't Use New Cap"

$
0
0

I'm sure I'm missing something simple here, but I'm having some issues with user caps.

In our multisite installation (~250 sites), we used some custom code to remove the default "Administrator" role and replace it with a custom role that has many of the same caps, but a few that are missing (yes, I realize we could have just removed caps from the Administrator role, but it seemed cleaner this way, in case we needed to add full admins back at some point).

In the past, we'd kept our admins from being able to activate plugins by not including the activate_plugins cap in the custom admin role. This week, we decided to give them that capability, but I can't get that working properly.

What I've done:
I have some code set up to see if the current user is a member of the custom role (umw_site_manager) and whether or not the user is able to activate_plugins. If they are a member of that role, but they do not have the cap, I have the code set up to modify the umw_site_manager role to add that capability to it.

What I expected:
After activating that code and loading the dashboard as a umw_site_manager user, I expected the user to see the "Plugins" menu in the admin menu. I refreshed the dashboard a few times to make sure that things got updated in the database and the autoload cache had been updated appropriately.

What I got:
The user still does not have the "Plugins" menu in the admin menu. If I try to go directly to the plugins page by using the URL, I get the "You dont' have sufficient permissions..." error.

I'm not sure why it's not working the way I'd expect. As I said, I'm sure I missed something simple, but I'm just not seeing it. I suspect it's one of two things, but I could be wrong:

  1. The activate_plugins cap might be insufficient to allow a user to see the plugins menu and activate plugins (though, I've looked through the WordPress source, and it seems that that cap should be sufficient)
  2. There is some function I need to use to reconcile the user caps with the role caps, but I'm missing it.

I've checked the database, and the activate_plugins cap has definitely been added to the appropriate role. The capabilities entry in the usermeta table shows that the test user has two caps (gform_full_access - a capability used with Gravity Forms, and umw_site_manager), so it doesn't look like the individual capabilities for the user are overriding the role capabilities.

What am I missing? Any help would be greatly appreciated. Following is the related bit of code I'm using for this purpose:

if ( current_user_can( 'umw_site_manager' ) && ! current_user_can( 'activate_plugins' ) ) {
			$role = get_role( 'umw_site_manager' );
			$role->add_cap( 'activate_plugins' );
			/* I put this next line in, just in case */
			wp_update_user( array( 'ID' => get_current_user_id(), 'role' => 'umw_site_manager' ) );
		}

I've also written some code to output the current user object in an HTML comment within my admin area while I'm testing, along with the results of current_user_can( 'activate_plugins' ) and the results of $current_user->has_cap( 'activate_plugins' ).

The dumped data from the user clearly shows activate_plugins within the allcaps property, but both of the tests return boolean false.

Any ideas what might be stopping this capability from being applied the way I'd like it to be to my users? Thanks.

Viewing all 8245 articles
Browse latest View live




Latest Images