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

daryo on "Go to new post after publishing post"

$
0
0

Hi, I have loads of posts to put on my page so I was wondering if it's possible when I publish new post to make WP go to new post page, not the edit post page, it would save me loads of time. Thank you!


vibhu000 on "Contact Form 7 has been compromised"

$
0
0

Hello,

Contact Form 7 plugin in my website (www.tricky-photoshop.com) is acting weirdly. Few hours ago, I received a spam email of the FIFA 15 coins. Since then, whenever I receive any email from my Contact Form 7, the "from" address is wordpress@tricky-photoshop.com.

The weird thing is that I have never created wordpress@tricky-photoshop.com but all of a sudden, I am receiving emails from wordpress@tricky-photoshop.com. Since then, at the end of every email, "Sent by an unverified visitor to your site." is written.

Any help would be highly appreciated.

Thank You,
Vaibhav

MV789 on "[Twenty Fouteen] Reduce width of site by decreasing left side column width"

$
0
0

Hi there,
A big thanks to the community for all their posts/support so far. Despite searching extensively through the posts/questions I have been unable to properly resolve my issue without causing additional problems. I am making changes using jetpack CSS. My goal is to:

1. Reduce the overall site width (beyond what I currently have done) but maintain the current width of my central column and right (content) sidebar.

To compensate for the reduction of total site width, I would like to reduce the width of my left sidebar AND its associated submenu items.

Currently I cannot reduce the width of the site much more using the below code without squishing the central column and right content sidebar:

/* This Block Adjusts the Overall Theme Width */
footer[role="contentinfo"] {
max-width: 1000px;
}

@media screen and (min-width: 1080px) {
.site {
max-width: 1000px;
}

.ie .site {
max-width: 1000px;
position: centre;
}

.site-header {
max-width: 1000px;
position: centre;
}
}
When I use the below code to adjust the left side bar width I have the issue of the submenu navigation widths remaining unchanged (too wide), and the horizontal lines that mark the space between pages of my menu remaining extended too far to the right(at their original length):
@media screen and (min-width: 1080px) {
.site:before {
width: 130px;
}
#secondary {
width: 130px;
}
}

I hope that my question makes sense and was asked according to forum rules.
Thanks for your help in advance!

My site can be view at http://www.LearningAT.ca

JoZey on "Removing Title Space in Widget"

$
0
0

I have tried everything to remove the space left when I do not include a title in a text/image widget dev.lovingspoonful.org - see the Donate Now image in Footer 1 (left). I want it to top align with the titles in Footer 2 and 3 - to remove the space reserved for the titles. Any suggestions? You'd think WP would just have a simple checkbox to include/exclude a title in the widget.

macika on "?page_id=9236&cid=Mjg%3D What is that?"

$
0
0

Hi!

In Google Webmaster tools I see a lot of crawling errors, 404 pages, most of them looks like that:

http://www.mysite.com/?page_id=9236&cid=Mjg%3D
?page_id=9236&cid=NTU%3D
?page_id=9236&cid=MjU%3D
?page_id=9236&cid=MjA%3D
?page_id=9236&cid=Mjc%3D

What the hell are these entries?

macika on "page_id=9236&cid=Mjg%3D What is that?"

$
0
0

Hi!

In Google Webmaster tools I see a lot of crawling error (404 errors) entries like that:

http://www.mysite.com/?page_id=9236&cid=Mjg%3D
?page_id=9236&cid=NTU%3D
?page_id=9236&cid=MjU%3D
?page_id=9236&cid=MjA%3D
?page_id=9236&cid=Mjc%3D

What is that?

hitu165 on "How to count number of records found in a database table?"

$
0
0

I am new to WordPress development & tried to learning plugin development.I have created a custom table from which i want to show the number of records found.I have tried the below code but it always shows 1 as a result irrespective of number of rows in a table.

//To show number of rows in table
function DB_Tables_Rows()
{
global $wpdb;
$table_name = $wpdb->prefix . 'mydata';
$count_query = "select count(*) from $table_name";
$num = $wpdb->get_var($count_query);

$num = $wpdb->num_rows;

echo $wpdb->num_rows . 'Rows Found';

}

svlada6 on "Problem with plugin translation"

$
0
0

Hello, I have problem with translation of plugin. I used poedit for plugin translation. Ok i created po & mo files encoded in russian, and it works when i test on local machine. But when i upload my plugin on server, some charachers missing. Words are translated, but some charachters are showned in latin, not in cyrillic. Also i translate plugin into Romanian and works fine. In head i have utf-8. Can someone tell me what to check, could be something with theme, or fonts, or maybe with poedit? Very strange translation work on my local computer?


valdirljr on "Add title tag inside the gridview , in media library"

$
0
0

Hi,

I trying to add the tag title in Grid View, when i'm in media library.
I see in wp-includes/js/media-view.js, line 4629, when this js gets the title. I will not edit the core of WP, but i tested it with :
'title': this.model.get( 'title' ),
and works fine. There is a better way to make what i want?

Greets

360zen on "How to force Tiny_MCE links to be relative"

$
0
0

Hi there,
I am in the process of setting up a WordPress installation that appears at two domains (i.e. http://example1.com and http://example2.com). I have managed to figure out how to switch the theme and the Site URL based on the SERVER_NAME. However, one of the few remaining problems is that links to existing content added by an user through the WYSIWYG editor still get the current site root added to them. So, if I am logged in to example1.com and add a link to an internal page through the "Existing Content" feature, "http://example1.com/" is appended to the beginning of the URL.

So, my question is, how do I stop this behavior? I would really like internal links to be relative to the Site URL of the visitor, not the Site URL of the author.

I have looked at two plugins (Relative URL and Root Relative URLs) and both of them are too broad. They change every URL on the site, which I don't need.

I've tried adding this to my functions.php, with no success:

function my_mce_setup( $init_array ) {
	$init_array['convert_urls'] = 'false';
	$init_array['relative_urls'] = 'true';

	return $init_array;
}
add_filter( 'tiny_mce_before_init', 'my_mce_setup' );

I'm assuming I'm missing something about how Tiny MCE settings are passed...
EDIT: I'm also not sure that the "Link to Existing Content" feature is even related to Tiny MCE.

Before you reply, please understand that I already know that I'm stretching WordPress beyond what it is "intended" to do. I'm aware that WordPress is designed to only support absolute URLs, but I still need a solution.

Thanks in advance for any help!

-Justin

Cassie on "Enjoyhint installation into Wordpress site"

$
0
0

Hello,

I was hoping I could get some insight on how to install Enjoyhint into my WordPress site.

My knowledge of javascript is really limited so I'm learning as I go. This is the GitHub file: Enjoyhint and I'm stuck as to where I would place the "//initialize instance ..." portion of the code.

I would like the overlay to appear on the home page only. I have tried placing the code in the functions.php and the actual Home page, but the theme either breaks or nothing happens. I have uploaded the .js files and linked them appropriately (I think)

I've tried Reddit and even the GitHub's page to get some help but no response. :(

Help please.

sangshe on "Parallax slider/bootstrap slider image upload hacked?"

$
0
0

I am new to this forum and to WordPress issues. For the past three weeks I am not able to upload images to our Evolve theme in the Parallax slider. A pop up box comes up stating "Cheatin' uh?" occurs with no image uploading features at all. I know very little about code. I can maintain the site as is, however this one is keeping our small non-profit from being able to update our website images.
the slider is on our home page.
http://www.meditationcharlotte.org

One will not be able to see this issue just by looking at the website.

maxx0106 on "JetPack could not contact Wordpress.com"

$
0
0

Hi WP team,

Tried many times to install the JetPack plugin, got an error message.
Please see screenshot:
http://ominc.cn/wp-content/uploads/2014/12/jetpack-prob.jpg

I then uninstalled the plugin, tried re-installing it and failed again:

Installing Plugin: Jetpack by WordPress.com 3.2.1
Downloading install package from https://downloads.wordpress.org/plugin/jetpack.3.2.1.zip…

Unpacking the package…

Installing the plugin…

Destination folder already exists. D:/INETPUB/VHOSTS/ominc.cn/httpdocs/wp-content/plugins/jetpack/

Plugin install failed.

Return to Plugin Installer

---------------------

My website domain: ominc.cn

Please advise, thank you!!!!!

Prabhu Bakiyaraj Chelladurai on "WordPress Fatal error: require(): Failed opening required"

$
0
0

( ! ) Fatal error: require(): Failed opening required '' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wordpress/wp-content/plugins/wp-mvc/core/controllers/mvc_controller.php on line 265

I get this above error despite trying so many suggestions in the forums, stackexchange etc.

I developing a plugin in WordPress 4.0.1 using WP MVC, and it also encapsulates ORM concept that is in-built with WP MVC. I couldnt find a solution for this.
Below is the code: (Admin Controller)

/plugins/w2-store/app/controllers/admin/admin_geozone_rules_controller.php

class AdminGeozoneRulesController extends AdminController {

    // Default items in Geozone Rules view
    var $default_columns = array(
                                'id',
                                'Geozone' => array('value_method' => 'admin_column_geozone'),
                                'Country' => array('value_method' => 'admin_column_country'),
                                'Zone' => array('value_method' => 'admin_column_zone'),
                                'ordering');

    // Function to add a new record in wp_w2store_geozonerules table
    public function add() {
        $this->set_geozones();
        $this->set_countries();
        $this->set_zones();
        $this->set_geozonerules();
        $this->create_or_save();
    }

    public function edit() {
        $this->set_geozonerules();
        $this->set_geozones();
        $this->set_countries();
        $this->set_zones();
        $this->set_object();
        $this->verify_id_param();
        $this->create_or_save();
    }

    // Function to display the Country name Geozone Rules view
    public function admin_column_country($object) {
        return $object->country->country_name;
    }

    // Function to display the Geozone name Geozone Rules view
    public function admin_column_geozone($object) {
        return $object->geozone->geozone_name;
    }

    // Function to display the Zone name Geozone Rules view
    public function admin_column_zone($object) {
        return $object->zone->zone_name;
    }

    // Data retreived from four different tables using joins
    private function set_geozonerules() {

        $this->load_model('GeozoneRule');
        $geozonerules = $this->GeozoneRule->find(array(
                                                'joins' => array(
                                                'Geozone', 'Country', 'Zone'
                                                ),
                                                'includes' => array(
                                                'Geozone', 'Country', 'Zone'
                                                ),
                                                'selects' => array(
                                                                'Geozone.id', 'Geozone.geozone_name',
                                                                'Country.id', 'Country.country_name',
                                                                'Zone.id', 'Zone.zone_name',
                                                                'GeozoneRule.id', 'GeozoneRule.ordering'
    /*                                                          ),
                                                'conditions' => array(
                                                                    'GeozoneRule.geozone_id' => 'Geozone.id',
                                                                    'GeozoneRule.country_id' => 'Country.id',
                                                                    'GeozoneRule.zone_id'    => 'Zone.id'
    */                                                          )
                                                        )
                                                );

        $this->set('geozonerules', $geozonerules);
    }

    private function set_geozones() {
        $this->load_model('Geozone');
        $geozones = $this->Geozone->find(array(
                                        'selects' => array(
                                        'id',
                                        'geozone_name'
                                        )
                                        ));
        $this->set('geozones', $geozones);
    }

    private function set_countries() {
        $this->load_model('Country');
        $countries = $this->Country->find(array(
                                        'selects' => array(
                                        'id',
                                        'country_name'
                                        )
                                        ));
        $this->set('countries', $countries);
    }

    private function set_zones() {

        $this->load_model('Zone');
        $zones = $this->Zone->find(array(
                                    'selects' => array(
                                    'id',
                                    'zone_name'
                                    )
                                    ));
        $this->set('zones', $zones);
    }

    public function geozonerule_edit_link($object) {
        return empty($object->geozonerule) ? null
                                            : HtmlHelper::admin_object_link($object->geozonerule,
                                                array('action' => 'edit'));
    }

    public function geozonerule_view_link($object) {
        return empty($object->geozonerule) ? null
                                            : HtmlHelper::admin_object_link($object->geozonerule,
                                                array('action' => 'view'));
    }

}

?>

(Public Controller)

/plugins/w2-store/app/controllers/geozone_rules_controller.php

class GeozoneRulesController extends MvcPublicController {

    var $after = array('set_geozonerules');

        public function set_geozonerules() {
            $this->load_model('GeozoneRule');
            $geozonerules = $this->GeozoneRule->find();
            $this->set('geozonerules', $geozonerules);
        }

        // Overwrite the default index() method to include the 'is_public' => true condition
        public function index() {

        $objects = $this->GeozoneRule->find(array(
                                    'joins'     =>  array('Geozone', 'Country', 'Zone'),
                                    'includes'  =>  array('Geozone', 'Country', 'Zone'),
                                    'selects'   =>  array('Geozone.id, Geozone.geozone_name',
                                                    array('Country.id, Country.country_name',
                                                    array('Zone.id', 'Zone.zone_name',
                                                    array('GeozoneRule.id', 'GeozoneRule.ordering')
                                                    )
                                            )))
                                    );
        $this->set('objects', $objects);

        // pagination
        $this->params['page'] = empty($this->params['page']) ? 1 : $this->params['page'];
        $this->params['conditions'] = array('is_public' => true);
        $collection = $this->model->paginate($this->params);
        $this->set('objects', $collection['objects']);
        $this->set_pagination($collection);

        echo '<a href="admin.php?page=mvc_geozone_rules-add">Add New Geozone Rule</a>';

    }

    // GeozoneRule selects only GeozoneRule names and ids by default; to select all fields from GeozoneRule,
    // we'll overwrite the default show() method
    public function show() {

        $object = $this->model->find_by_id($this->params['id'], array(
            'includes' => array(
                            'Geozone',
                            'Country',
                            'Zone',
                            'GeozoneRule' => array(
                                                'selects' => 'GeozoneRule.*'
                                                )
                            )
                            ));

        if (!empty($object)) {
            $this->set('object', $object);
            $this->render_view('show', array('layout' => 'public'));
        }
    }
}

?>

Model:

class GeozoneRule extends MvcModel {

    var $table = '{prefix}w2store_geozonerules';
    var $primary_key = 'id';
    var $display_field = 'id';
    var $default_order = 'sort_name';
    var $includes = array('Geozone', 'Country', 'Zone');

    var $has_and_belongs_to_many = array(
                        'GeozoneRule' => array(
                                        'join_table' => array('{prefix}w2store_geozones',
                                                            'fields' => array('id', 'geozone_name')),
                                                        array('{prefix}w2store_countries',
                                                            'fields' => array('id', 'country_name')),
                                                        array('{prefix}w2store_zones',
                                                            'fields' => array('id', 'zone_name')),
                                                            'fields' => array('id', 'ordering')
                                                            )
                                        );

    public function after_find($object) {
        if (isset($object->geozonerules)) {
            $geozonerule_names = array();
            foreach($object->geozonerules as $geozonerule) {
                $geozonerule_names[] = $geozonerule->name;
            }
        }

    //  print_r ($object);
    //  exit;
    }

    public function after_save($object) {
        $this->update_sort_name($object);
    }

    public function update_sort_name($object) {

        $sort_name = $object->geozonerule_name;
        $this->update($object->__id, array('sort_name' => $sort_name));
    }

}

?>

Now the error i got:

`Warning: require(): Filename cannot be empty in /var/www/html/wordpress/wp-content/plugins/wp-mvc/core/controllers/mvc_controller.php
on line 265 Call Stack Time Memory Function Location . . 11 0.0659 3870616 require( '/var/www/html/wordpress/wp-content/plugins/w2- . .

Fatal error: require(): Failed opening required '' (include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/html/wordpress/wp-content/plugins/wp-mvc/core/controllers/mvc_controller.php on line 265 Call Stack Time Memory Function Location . . 11 0.0659 3870616 require( '/var/www/html/wordpress/wp-content/plugins/w2-store/app/views/admin/layouts/admin.php' ) ../mvc_controller.php:265 . .

Any possible solutions will be of much help. Thanks a lot.

HLG on "Mail Delivery System - messages being sent"

$
0
0

I am being inundated in my email saying that I am trying to send more than 150 message per hour and I have not created this spam email. The message is for mailer-daemon@just77.justhost.com and they all make reference to our website domain.

How do I stop this?

I don't recognised any of the email addresses?


B on "Change media URLs on upload"

$
0
0

I'm looking to, programmatically on upload, change the URL of a media file to its URL on a CDN. I.e. modify site.com/wp-content/uploads/file.jpg to be cdn.site.com/wp-content/uploads/file.jpg.

Essentially what I'm asking is: which hook should I tie into? If anybody has more code help, that's great, but I think hook is the big question.

People before seem to have been wondering this, so I think it'll be helpful to resolve. Note also: I'm aware that W3 Total Cache and other plugins do this; I'd actually like it changed in the database (not just filtered on post render/output), and need to use some of my own logic, so I need to code snippet in my code.

Many thanks.

jbkeefer on "WP_Query on post custom date field and delete posts."

$
0
0

Please take a look at the following. This bit of code looks to schedule an event that deletes posts that contain a date in the form of post meta data on a daily basis.

The event get scheduled properly but the script is not deleting the posts as intended.

Here is the part that needs a more experienced eye. Most say it looks fine, but it is ot working.

NOTE: i have dates stored the yyyy-mm-dd format and posts certainly have the custom field attached.

function expired_post_delete() {

$todays_date = the_date('Y-m-d');

$args = array(
		'post_type' => 'post',
		'posts_per_page' => -1,
		'meta_key' => 'date',
		'meta_query' => array(
			array(
				'key' => 'date',
				'value' => $todays_date,
				'type' => 'DATE',
				'compare' => '<'
				)
		)
);
     $posts = new WP_Query( $args );

	//  Cycle through each Post ID
    	foreach( $posts as $post) {
    	wp_delete_post($post_id);
	}
}

yegortitov on "index.php hacked"

$
0
0

Hi,

my index.php was hacked two times. This code was added in order to redirect searches from google (for exemple) in this website http://www.shoplouisvuiton.fr

[ Malware redacted, please do not post that here ]

I delete the code, changed passwords ..

Any idea ?

Jhowls on "Block sending for determined emails"

vytaulla51 on "how properly call an image in a javascript in WP"

$
0
0

Hi:

I'm using a little javascript for my menus in a responsive theme -- but I want to use an image for the menu button and can't get it to show up.

The script is:

jQuery(document).ready(function($){
/* prepend menu icon */
$('#mobinav').prepend('<div id="menu-icon">Menu</div>');

/* toggle nav */
$("#menu-icon").on("click", function(){
$("#navbar").slideToggle();
$(this).toggleClass("active");

});
});

The script is in a js folder in the theme root. In the div above I want to use a small graphic instead of the word "Menu". In my initial markup and styling, using BBEdit, I can use a graphic as follows:


jQuery(document).ready(function($){
/* prepend menu icon */
$('#mobinav').prepend('<div id="menu-icon"><img width="117" height="33" alt="menulines" src="images/menulines.png"></div>');

/* toggle nav */
$("#menu-icon").on("click", function(){
$("#navbar").slideToggle();
$(this).toggleClass("active");

});
});

and it works. But that same code generates a "missing image" image when I make the theme live in WordPress. I tried doing this:


jQuery(document).ready(function($){
/* prepend menu icon */
$('#mobinav').prepend('<div id="menu-icon"><img width="117" height="33" alt="menulines" src="<?php bloginfo('template_url'); ?>/images/menulines.png"></div>');

/* toggle nav */
$("#menu-icon").on("click", function(){
$("#navbar").slideToggle();
$(this).toggleClass("active");

});
});

But that isn't working either. The relevant graphic is in the images folder in the theme directory. This is a custom theme.

The menu button appears when viewport is less than 601 px -- can see it at this site (which is still being developed and populated): http://www.comhab.org/resp/

If I'm in the wrong forum please let me know -
Thanks!

Viewing all 8245 articles
Browse latest View live




Latest Images