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

suneetpant on "How to run two queries one after another in php"

$
0
0

I have two mysql queries which i want to run. First query doesnot return anything but the second query runs perfectly. I am not able to figure out where I am wrong. As such kindly help :
Query 1 : [ Problem is defined as under: ]
Mysql query is :
'
$mid = trim($_SESSION['login_mail']);
$retrval = "select user_id from user_dtls where u_emailid='{$mid}'";
$result1=mysqli_query($connection, $retrval);
confirm_query($result1);
'
Soon after this query there is another one :
Query 2 : running perfectly.
'
$insertquery = "insert into utmp_orders (tord_dt, user_id, file_path, file_name, cat_id, pay_flag) values('{$curr_dt}',1,'{$filepath}','{$filename}',1,'N')";
$finalresult = mysqli_query($connection, $insertquery);
confirm_query($finalresult);
'
In the second query, the second value which is shown 1 is actually $result1. The second query runs only when the first query is removed.
I just can't figure out where I am wrong as the select statement which i have passed is ok. Pls help


kscomp0 on "Problems using wp_enqueue_script Linked script not working"

$
0
0

I am trying to load some javascript that modifies table data on select pages.
The javascript is contained in an external file that is located in the js folder under a child theme (hueman-child-master).

My understanding is that wp_enqueue_script and wp_register_script are the proper ways to load javascript onto wordpress pages.

I can get the script to work if I use a plugin that adds the whole script to the footer, but I wanted to add it without using an additional plugin.
Eventually I was going to use a shortcode to run wp_enqueue_script, but for now I have it set up as follows in the child theme’s php file:

<?php
/* ------------------------------------------------------------------------- *
 *  Custom functions
/* ------------------------------------------------------------------------- */

	// Add your custom functions here, or overwrite existing ones. Read more how to use:
	// http://codex.wordpress.org/Child_Themes
function register_my_scripts() {
     wp_register_script ( 'tablechanger', plugins_url( '/js/tablechanger.js', __FILE__ ), array(), '1.0', true );
     wp_enqueue_script ( 'tablechanger' );
}

add_action( 'wp_enqueue_scripts', 'register_my_scripts' );

/* add_shortcode ( 'tablechanger', 'tablechanger_handler' );
function tablechanger_handler() {
     wp_enqueue_script ( 'tablechanger' );
} */
?>

The script gets registered, or at least its link shows up in the page, but it doesn’t run.
Do you have any suggestions?
This is being done on a localhost for now.

LanceSurgeGG on "Comnining all CSS into header"

$
0
0

Hi forum

In a further attempt to speed up first load of my site, I've read about combining all CSS into the Header.php

I have WP Super Cache plugin installed and using minify CSS already, will these two practices conflict?

Has anyone combined all their CSS for pasting into Header before, would you recommend this and if so, please could you write a short description of where to paste as my current Header.php does not have an entry for style...

Any guidance on this would be appreciated,

Thank you

Lance

Guido on "Load default text in post / page textarea field"

$
0
0

Hi,

When I create a post (product) I need to copy-paste a couple of pre-defined lines in the textarea field. These lines are the same for each product.

Is it possible to load these pre-defined lines in textarea field when creating a new post?

Guido

simplerider on "How can I make my site a social network?"

$
0
0

I would like my website to be where you can sign in, post a video, comment on other peoples videos, create a popular page, top grossing etc. But i tried many different options like buddypress but i dont really like it. I also dont like how the login is connected through wordpress. I want my website like http://www.newschoolers.com but for snowboarding... Someone please help me out.

robpoet on "Been hacked"

$
0
0

I lost the thread before, yes so what can I do to restore my site please?

raelyntan2212 on "What CSS Do I Need To Change To Make Popular Plugin Look Better"

$
0
0

Hey, my website is http://burningforsuccessdotcom

I just bought a plugin (Ilc-tabs-widget) to display my posts on the sidebar (its on my home page, the one higher up). However it looks really ugly.

I'm wondering how I can change the CSS to make it look like the popular widget (the one at the bottom at "Test"?)

It has some features I need however it looks so ugly so I really need to change the CSS... Please help!

c05338 on "Categories List into Registration Form"

$
0
0

Hello,

I'm trying to create a custom user registration form used for Educational website.

Is it possible to automatically retrieve categories of posts (custom posts) in the registration form.

The form should be:

username :
password :
first name:
last name :

optional

<category list> (courses list)

if user choose <category 1> it will automatically show related sub-categories example:

<course1>
- <sub-course-1>
- <lesson 1>
- <lesson 2>
- <sub-course-2>
- <lesson 1>
- <lesson 2>

Is there a way to do such thing into registration form?


legion_x on "Custom Field not showing code"

$
0
0

Hello,

i would like to add a custom field to the general settings page of wordpress for inserting google tag manager code:

add_filter('admin_init', 'my_general_settings_register_fields');

function my_general_settings_register_fields()
{
register_setting('general', 'google-tag-manager', 'esc_attr');
add_settings_field('google-tag-manager', '<label for="google-tag-manager">'.__('Google Tag Manager' , 'google-tag-manager' ).'</label>' , 'my_general_settings_fields_html', 'general');
}

function my_general_settings_fields_html()
{
$value = get_option( 'google-tag-manager', '' );
echo '<input type="text" id="google-tag-manager" name="google-tag-manager" value="' . $value . '" />';
}

I use

<?php echo get_option('google-tag-manager'); ?>

in the template for displaying. it's working, but on instering code into the textfield it returns:

& lt;!-- Google Tag Manager --& gt;

so the script code isn't shown correctly..."<" becomes "& lt;" for example.

Can you help me to solve this problem

pSyToR on "Plugin Development - jQuery ... How the... am i supposed to..."

$
0
0

Hi Everyone,

I found 100s of different ways to do it... But I just can't get my head around it... I just cannot find anything clear on how to do it... And whatever I try it just doesn't work.

I tried to read the codex... and the developer handbook... and many other other... website... and even more than that... I just cannot make jQuery work...

Does ANYONE has a clear guide on how to do it... Or an example I could include in my file to understand how this thing work?

For example I did the following:

function easyreg_load_jquery(){
    wp_enqueue_script('jquery');
}

add_action('wp_enqueue_scripts', 'easyreg_load_jquery');

Load the jQuery and then run it with the hook for wp_enqueue_scripts.

Once this is done, from what I read everywhere I should be able to use a jQuery script inside my plugin (directly not even in a .JS file).

jQuery(document).ready(function(){
/do something
});

But "jquery is not recognised"...

I tried to link to a JS script... but it doesn't seem to be loaded... Which is why I would need a script to give me a PROPER working example.

I am not pointing to any other jQuery in my plugin, it's the only time I'm calling it...

I just need a simple script to disable some fields in my Admin section of my plugin I cannot believe it is so complicated... I'm sure I'm just missing a little something

twicealive on "Do you know how to get the SubDomain name for the current site?"

$
0
0

Hello,

Does anyone know how to get the current subdomain "site" using php?

The part I'm looking to get is seen in the subdomain portion of the url:

SITE.myDomain.com

I don't want the browser uri, but I do want the SITE that was defined by the user during setup.

I would appreciate any help.

Thank you,
Michael

suifengtec on "HELP:$wpdb->update only update only value."

$
0
0
global $wpdb;
$db_name=$wpdb->someone;
$id=5;
$result =1;
$note='Test note';

$data=array(
		                'is_success'=>$result,
		                'note'=>$note,
		                'success_time'=>date("Y-m-d H:i:s"),
	          );

$where=array(
                                'id' => $id
                     );
$format = array(
                               '%d',
                               '%s',
                               '%s'
                       );
$where_formart = array(

                                '%d'
                       );

$ok = $wpdb->update($db_name,$data,$where,$format,$where_formart);

I want to update 3 fields,but it only update the 'success_time' field,and $ok is true,why?
PS: all fields to be updated allow null.
Did you know?

BrandonTW on "Display Featured Image Preview in post list?"

$
0
0

I find myself posting a lot then going back and setting the featured images and I thought it would be more convenient if I could display a preview & possibly upload or set an image from the All Posts page in the backend. I can't find a plugin to do this and the only thing I came across was this http://pastebin.com/GPqwWuKr but I have no idea how to set this up. could anyone help me with this please?

HyperTractive on "Custom Registration Page"

$
0
0

I'm trying to build a registration page similar to that of Gmail's (as an example). To do this I am attempting to follow the example #2 given in the codex page "Plugin API/Action Reference/register form" but I cannot get it to work.

I have created a file called "regpager.php" (code below) in my site's plug-in directory and then activate it via the dashboard but when I access http://mysite.com/wp-login.php?action=register I see no change.

<?php
/*
Plugin Name: Registration Page Changer
Description: This is just a test plugin.
Author: Mike B
Version: 0.1
Author URI: http://mi.ke/
*/

function my_translate()
{
   $your_content=ob_get_contents();
   $your_content= preg_replace('/\<label for="user_login"\>(.*?)\<br/',        'Usernumia: ',$content);
   $your_content= preg_replace('/\<label for="user_email"\>(.*?)\<br/',        'Email Sior:',$content);

   ob_get_clean();
   echo $your_content;
}
add_action( 'register_form', 'my_translate' );

?>

Any help you guys are able to offer would be super appreciated :)

Thanks everyone.

neiloughton on "Localization Help"

$
0
0

I am trying to edit some of the terminology used within Wordpress to better suit my application needs.

Specifically Categories and Tags.

For example, I am using Wordpress in this instance for Education purposes therefore i would like to change Category / Categories to Expected Outcomes and Tags to Subjects.

I am currently attempting this using a .po editor and Localization. The issue is it only seems to give me options to change the descriptive text and not the actual menu / widget text.

Any help would be greatly appreciated.

Neil


philipp1121 on "Show Latests Posts outside Wordpress"

$
0
0

hey guys,

I would like to display the 5 latest posts from my bbpress forum within a seperated frontpage (phpfrontpage.php), which is located on the same server/directory as the Wordpress installation

like:
Frontend/phpfrontpage.php
Frontend/Blog

I also wanted to list the last 5 Blogposts in the Blog. To do this, I simply included "/blog/wp-load.php" and did

$recent_posts = wp_get_recent_posts(array(
'numberposts' => 5
));

Is there a similiar way to do this for the latest bbpress topics instead of the latest blogposts?

Thank you very much!

Jmantis on "Find a code in plugin files"

$
0
0

Hi,

Is there a way to search through all plugin files at the same time? I need to find one particular code, but there are so many files in the plugin that it takes ages to search in every single one of them.

Thanks

deltafactory on "wp_cache_add_non_persistent_groups()"

fashionistamomma on "Hack from code"

$
0
0

I installed a code I copied from the forums here and now my blog is completely gone I can't log into my wordpress or anything. It's just a white page. I am assuming the code I copied was a hack if someone could please help me asap.

holymp2006 on "Custom Radio Button Column in Posts (Admin Screen)"

$
0
0

I want to add a Custom Column in Posts manage page. I want this column to just have radio buttons, with which I can select a particular post. then include that selected post's ID in a query anywhere in a theme like;

$featured = selected_with_radio(); /***or a anything like that***/
$args = array(
     'post_id' => $featured
      );

I'd really appreciate any help.

Viewing all 8245 articles
Browse latest View live




Latest Images