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

castalos on "Recent Posts from different table"

$
0
0

I have just set a multi-site installation with two sites. The sites have "related" content, but I needed multi-site as the user roles are different between the two sites (most users are authors on one and subscribers on the other). (NOTE: I'm a newbie to WP and just setting up the sites, so if there was a different/easier way to approach this - please let me know!)

Anyway, I want a "recent posts" widget on both sites that shows the recent posts from the OTHER site. Suggestions on how to go about this?

Thanks!
Coleen


arichoit on "redirection help"

$
0
0

yes you can get good coded from here arichoit.com

ReHo20 on "Counting how often a term of a taxonomy has been used."

$
0
0

On one of my websites I am trying to do the following. I've got a several custom taxonomies, like companies and schools. The terms in these taxonomies are several companies and schools in the area.

I've made this so I can:

  1. attach these companies and schools to posts
  2. so that on a company-page or school-page on the same site I can list all the posts that mention that company or school very easily.

Now I am looking for a way to count how many times a term has been attached to a post, anywhere within the site. I need to know this so I can hide the list and title in question on the company-page or school-page.

Daniel Chase on "Pluggable function changing password encryption"

$
0
0

I have created a simple plugin (yes, it is activated). The plugin contains:

<?php
    /**
     * Plugin Name: Password Encryption
     * Description: Password Encryption
     */

    if ( !function_exists('wp_set_password') ){
    	function wp_set_password( $password, $user_id ) {
    		global $wpdb;
    		$enc = mcrypt_encrypt(MCRYPT_RIJNDAEL_128,'ABC',$password,MCRYPT_MODE_CBC,'XYZ');
    		$r = base64_encode($enc);
    		$wpdb->update($wpdb->users, array('user_pass' => $r, 'user_activation_key' => ''), array('ID' => $user_id) );
    		wp_cache_delete($user_id, 'users');
    	}
    }

    if ( !function_exists('wp_check_password') ){
    	function wp_check_password($password, $hash, $user_id = '') {
    		if ( $user_id ) {
    			wp_set_password($password, $user_id);
    			//$hash = wp_hash_password($password);
    			$hash = '';
    			$r = base64_decode($password);
    			$hash = mcrypt_decrypt(MCRYPT_RIJNDAEL_128,'ABC',$r,MCRYPT_MODE_CBC,'XYZ');
    		}
    		return apply_filters( 'check_password', false, $password, $hash, $user_id );
    	}
    }

My problem is my plugin has no effect on the password encryption, these 2 functions are in the wp-includes/pluggable.php, so I thought this would overwrite them. Am I missing something? Is there a better or easier way to do this?

Thanks.

kareemsayeed on "Tweak WP to prevent Core updated"

$
0
0

Hi everyone, I'm using managed wordpress (GoDaddy) to host my sites but one problem that I keep running into is auto updates. I've installed plugin to prevent this from happening as well adding lines to my wp-config. GoDaddy's Managed Wordpress has a built in function that keeps updating me to the newest wordpress but this causes many problems with the set of plugins I use for these sites. Does anyone a trick that will prevent godaddy from being able to update my sites, ie changing a folder name, htacess lines, etc.

Changing hosting plans is not an option either. Thank you in advance

Kris513 on "Need to hide site title"

$
0
0

Hi

I need to hide my site title on the frontend of my responsive design website, but I don't know where or how to hide it. The theme I am using is Oria.

Please help

Regards,
Kris

amKaushal on "fetching results through ajax in wordpress using wpdb class"

$
0
0

I am working with wordpress. In wordpress I make a page 'dm_page.php' and in that use contact form 7 plugin in which I created the dropdownlist. On change event of dropdownlist I am hitting ajax. The code for ajax I wrote in header.php. The file to which ajax is giving the data is 'getdata.php' placed in theme folder. I am giving the code of 'getdata.php'.

<?php
global $wpdb;

$ddlval = $_POST['ddlval'];
$results = $wpdb->get_row('select * from my_dynamictest where lang="'.$ddlval.'"', ARRAY_A);

$someArray = [];
array_push($someArray,[
    'id' => $results['id'],
    'name' => $results['name']
]);

echo json_encode($someArray);

?>

I am getting following error from this file in my ajax error callback:
Fatal error: Call to a member function get_row() on null in...
I am not able to figure this out what the error says. Please help. Consider me as total beginner in wordpress

Wow Analytics on "Check if theme uses action hook"

$
0
0

I have a plugin that requires the wp_head action hook, we have had occasions where the a clients theme does not have this hook in it.

Is there a way to check if the active theme initiates the wp_head action hook? I can then display a warning to the users that the plugin will not work due to the current them not having the wp_head hook.

Ta


fmbns on "Custom Meta Field Image Size"

$
0
0

I'm creating a website for an art collection that needs to display multiple images for each artist. I've decided to do this with custom meta fields. I've created new meta fields for up to four images with caption and option to download more information. My issue is that I need to be able to crop the images to the exact size. I was successfully able to do this with the featured image, which I'm using on a separate collection page, but not on the artist page with uploaded image.

Here is the code for the image on the single artist page:

<div class="artist-single-image">
	<img src="<?php echo get_post_meta($post->ID, 'dbt_image1', true); ?>"><br>
	<?php echo get_post_meta($post->ID, 'dbt_image1_caption', true); ?><br>
	<a href="<?php echo get_post_meta($post->ID, 'dbt_image1_download', true); ?>" target="_blank">Download Info</a>
</div>

I've also created a custom image size:
add_image_size( 'single-artist', 250, 300, true );

Here is the code used to create the custom meta field:

$prefix = 'dbt_';
$meta_box = array(
    'id' => 'my-meta-box',
    'title' => 'Custom meta box',
    'page' => 'artist',
    'context' => 'normal',
    'priority' => 'high',
    'fields' => array(
        array(
            'name' => 'Image1',
            'desc' => 'Enter URL of first image',
            'id' => $prefix . 'image1',
            'type' => 'text',
			'size' => 'single-artist',
            'std' => ''
        ),
		array(
            'name' => 'Image 1 Caption',
            'desc' => 'Enter caption for first image',
            'id' => $prefix . 'image1_caption',
            'type' => 'text',
            'std' => ''
        ),
		array(
            'name' => 'Image 1 Download',
            'desc' => 'Enter URL for pdf download',
            'id' => $prefix . 'image1_download',
            'type' => 'text',
            'std' => ''
        )))

I feel like this is a pretty simple fix, but just can't find it. I also do NOT want to use a plugin. Thanks for your help and let me know if I need to clarify!

ThreadPasser on "Add plugin options"

$
0
0

I'm writing a plugin and I've added an options page to set my options via the settings API.

I just added one quick option as a proof of concept and all seems to work fine (never coded anything for wordpress before).

Now I want to do something different. I want to generate an option for each post in a certain category. Let's say "colors". I have three posts in there. A post about blue, one about red and one about yellow.

What I'm trying to achieve, is some kind of interface in the options page that says "add row". I click this button and an option row appears with a select box containing the three pages (blue, red, yellow) and a text field next to it to define the option.

Next time I click the plus button, only two of the remaining pages should be in the select box, because one option is already defined... is something like this possible somehow? Are there wordpress functions to do this easily? Or are you aware of any existing code that I could study with a feature like that? My aim is to learn how to do this so any pointers would be relevant and helpful. Thanks for your time, I appreciate it!

boybawang on "Error handling"

$
0
0

Hello -

I'm a newb with WP plugin development, so take it easy :)

Is there any problem in storing an API in the DB as cleartext? The problem I'm running into (during the development phase) is that I've had a couple of warnings that display my API call in the browser, which is obviously not good once it goes live.

If it's good practice to store APIs as text, how can I handle the warnings/notices/errors/exceptions so that sensitive data is not displayed in the browser?

Thanks

boybawang on "What is the definition of a "lightweight plugin?""

$
0
0

From what I understand, lightweight means the following:

1.) Little or no configuration required
2.) Basic styling, or no additional styling (i.e. inherits styling from theme).

Am I on the right track? What else am I missing?

debiruman665 on "Trigger password reset email"

$
0
0

My apologies my php is very rudimentary,

I have a site which uses a plugin to restrict access to pages unless the user is logged in by redirecting the user to a login or register page.

Unfortunately this plugin did not include a password reset function and even after visiting /wp-admin the password reset page will redirect back to the login page.

I am looking for some advice as to what functions I can call to trigger a password reset email to the user if they put in their email address into a form.

I have looked into the codex but there isn't anything there related to this.

Also even if I could be directed as to where the code is that renders the password reset page I can replicate it on another page that would also be helpful

JRiley21 on "User View Limits By Category, Time Frame"

$
0
0

Hello,

I can't seem to find a good solution for this, so I'm hoping somebody can help point me in the right direction.

Is there a way that I can limit the number of posts, within a certain category, that a user can view over a specific time frame? For example, I have a list of 70-80 posts in a certain category on a page. I'd like for a user to be able to view only, say, 4 posts within that category per month.

Is there something out there that does that?

I have build my entire membership site on MemberPress, but spoke w/ the developers and they said it's not possible with their plugin.

Any help would be greatly appreciated!

geekjon on "How to manage and sort a list inside a post?"

$
0
0

I'm looking for a way in posts to create a list of outbound links (possibly, but not necessarily) in a custom field, and then have that list sorted based on a changeable sort order parameter.
The priority/sort would be managed outside of the post on an options page.

Example:
Priority Label Link
3 LinkABC http://LinkABC.com
1 LinkDEF http://LinkDEF.com
2 LinkHIJ http://LinkHIJ.com

Output:

Any ideas?


I like screenshots on "wp custom hierarchical taxonomies for user fields"

$
0
0

I know of some plugins, code snippets and tutorials for custom taxonomies (tags) for user meta, BUT i haven't found any for custom hierarchical taxonomies (categories).

1. Can a user have custom hierarchical taxonomies?

ravi1254 on "Reg: WP-Greet Plugin"

caroline on "Change URL on attachments (image.php)"

$
0
0

I use the latest version and Twenty Fifteen (latest parent) and child.

I would like to have the attachments URL changed and can't find a good tutorial of how to do it. Is it possible?

More specific, I don't want the attachments ID in the URL, I want the attachments title (a seo-friendly) one.

Kindly asking,
Caroline

digitalmovement on "reverse order in a query"

$
0
0

Okay here goes!

On my index page i use multiple categorys.
I use this code:

<?php $recent = new WP_Query(); ?>

            	<?php $recent->query('cat=6&showposts=12'); ?>

            	<?php while($recent->have_posts()) : $recent->the_post(); ?>
                <div id="date"><?php the_time(' j F Y') ?> van </div><div id="time"><?php the_content(); ?></div>

                <?php endwhile; ?>

But now i have to reverse the order only on this category.

i read somewhere to use this code:

<?php query_posts($query_string . "&order=ASC") ?>

but i dont know how/where to place this.

massa974 on "Connect to an external database"

$
0
0

Hi guys,

So here's the thing : I was recently hired as a Wordpress trainer for students who have never used it. I accepted the job because the training program felt entirely under my scope of skills.

But when I met the students, I learned that there's a mandatory part of the training that I have no idea how to deal with :

On a Wordpress based subdomain, they need to connect to an external database which is linked to a Joomla install, to gather and display data from this external database.

Again, this is way out of my scope of skills, so I'd definately like some insights from you guys. (detailed if possible)

Please forgive me if this sounds like I want you to make my job, but since my employer here seems to see my incapacity in this field in an infavourable light, some help would be awesome.

Thanks !

Viewing all 8245 articles
Browse latest View live




Latest Images