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

edmael on "Insert date in Scroll post excerpt"

$
0
0

Hi, I'm trying to insert the date in every post that scrolls with this plugin.

The code I modified is:

if ( ! empty($spe_data) )
	{
		$spe_count = 0;
		foreach ( $spe_data as $spe_data )
		{
			$spe_post_title = trim($spe_data->post_title, @$spe_excerpt_length);
			$spe_post_title = mysql_real_escape_string($spe_post_title);
			$spe_post_date =  trim($spe_data->post_date);

			$get_permalink = get_permalink($spe_data->ID);

			$spe_dp_clean =  spe_dp_clean($spe_data->post_content, @$spe_excerpt_length);
			$spe_dp_clean = mysql_real_escape_string($spe_dp_clean);

			$dis_height = $dis_num_height."px";
			$spe_html = $spe_html . "<div class='spe_div' style='height:$dis_height;padding:2px 0px 2px 0px;'>";
			$spe_html = $spe_html . "<div class='spe_link'><a href='$get_permalink'>$spe_date $spe_post_title</a></div>";
/*			$spe_html = $spe_html . "<div class='spe_excerpt'>$spe_dp_clean...</div>";*/
			$spe_html = $spe_html . "</div>";

			$spe_x = $spe_x . "spe_array[$spe_count] = '<div class=\'spe_div\' style=\'height:$dis_height;padding:2px 0px 2px 0px;\'><div class=\'spe_link\'><a href=\'$get_permalink\'>$spe_post_date $spe_post_title</a></div></div>';"/*<div class=\'spe_excerpt\'>$spe_dp_clean...</div></div>'; "*/;
			$spe_count++;
		}

I added:
$spe_post_date = trim($spe_data->post_date);
but I get the date in this format: 2012-12-05 15:36:54 while I want it to be like this: 05 December, 15:36.
Is there a simple hack to accomplish this?


Businesscoachza on "Cannot login to dashboard - hacked."

$
0
0

Hi.
I've read through the posts on hacking but I'm still at a loss.
My new (Uncompleted site - http://jawitzeastlondonhouses.co.za/) was hacked about 2 weeks ago. I uninstalled WP from the Cpanel. I couldn't reinstall on the root (Kept getting a message that WP was already installed). I did a new install on sub directory http://jawitzeastlondonhouses.co.za/blog.

Today http://jawitzeastlondonhouses.co.za/blog gives me "Error establishing a database connection". I get the same if I try to login to my dashboard.

Strange thing is the site is back at http://jawitzeastlondonhouses.co.za/.
This is complete with the recent updates I did on the sub domain.

However if I try and login to http://jawitzeastlondonhouses.co.za/wp-login.php I'm redirected to http://jawitzeastlondonhouses.co.za/blog/wp-admin/

I also do not see the http://jawitzeastlondonhouses.co.za/blog/ in public/html, although i can access all the files (Through my Cpanel of http://jawitzeastlondonhouses.co.za)

Please anyone have any ideas?

Any help will be appreciated as I'm stuck!

Thank you

dilantha2 on "How to Optimize my new website?"

$
0
0

I have a newly created website http://www.seafoodcourt.com. I have to ask few questions regarding it...

1) How can I easily increase page rank of the site? is there any free website or plugins to do this?

2) How can I increase Alexa traffic rank?

3) Can I use adsense on that site and earn money? How many real visitors that I need for it?

SEO experts please help me ... :)

bxn5 on "query_posts post parent"

$
0
0

Hello. How i can get all child levels of post_parent or exclude one parent something like this post_parent!=27

Philipp on "Same Login for multiple WP installs"

xronax on "Front end posting, not working wp_redirect with 'cannot modify header informatio"

$
0
0

Im trying to make front end posting page but, sometime 'wp_redirect' is not working with 'cannot modify header information' error. adding data is working well but I don't know why is working well without error sometime, showing error sometime..

if (isset ($_POST['post_title'])) {
    $title =  $_POST['post_title'];
} else {
    echo 'Please enter a game  title';
}
if (isset ($_POST['description'])) {
    $description = $_POST['description'];
} else {
    echo 'Please enter the content';
}

$new_post = array(
    'post_title'    => $title,
    'post_content'  => $description,
    'post_status'   => 'publish',
    'post_type' => 'property',
    'tax_input' => array( 'property_type' => array($property_type), 'suburbs' => array($suburbs) )
);

//save the new post and return its ID
$pid = wp_insert_post($new_post); 

   //add thumbnail
    if (!function_exists('wp_generate_attachment_metadata')){
            require_once(ABSPATH . "wp-admin" . '/includes/image.php');
            require_once(ABSPATH . "wp-admin" . '/includes/file.php');
            require_once(ABSPATH . "wp-admin" . '/includes/media.php');
        }
         if ($_FILES) {
            foreach ($_FILES as $file => $array) {
                if ($_FILES[$file]['error'] !== UPLOAD_ERR_OK) {
                    return "upload error : " . $_FILES[$file]['error'];
                }
                $attach_id = media_handle_upload( $file, $pid );
            }
        }
        if ($attach_id > 0){
            //and if you want to set that image as Post  then use:
            update_post_meta($pid,'_thumbnail_id',$attach_id);
        }  //add thumbnail end

update_post_meta($new_post_id, 'tax_input', $property_type);
update_post_meta($new_post_id, 'tax_input', $suburbs);

//insert custom fields
update_post_meta($pid,'bathrooms',$_POST['bathrooms']);
update_post_meta($pid,'property_lease',$_POST['property_lease']);
update_post_meta($pid,'lost_found_date',$_POST['lost_found_date']);
update_post_meta($pid,'dog_sex',$_POST['dog_sex']);
update_post_meta($pid,'latitude',$_POST['latitude']);
update_post_meta($pid,'longitude',$_POST['longitude']);

$url = get_permalink( $pid );
wp_redirect($url);
exit();
}

get_header();

Sorry for my bad english, please help me out... and I'm not a programmer just understand some codes anyway...

Many thanks!!

StephanWizcorp on "User data encryption"

$
0
0

Hi there!

I'm using WordPress for a website project where there're some requirements about privacy respect. Thus, I would to encrypt my data user using a AES algorithm. As I'm developing a custom plugin, I have no problem to encrypt my user's sensitive data, because I provide the page that contains the registration for. But the problem is when it comes to display and modifiy these information in the core WordPress' backend. I couldn't find out where and how I could do that... I've looked for this information in the Internet for hours without being able to find it.
I've found this page https://code.google.com/p/wordpress-aes/ where a guy has developed a repo on Google Code, doing (almost) the stuff I want to do, and he tells that he sent a mail to people at WordPress for merging his code into WordPess' core. As that guy did not do a plugin or whatever, it lets me think that it's not possible to modify the reads and writes done from and to the database, from the backend...
Could some one help me about this issue?
Thanks in advance.

vikalp on "Configuring Superscrollorama in wordpress"

$
0
0

I am trying to make a website with WordPress. I want a parallax effect above my header image where I am going to put mountains. I just found a cool parallax effect called superscrollorama and downloaded the zip folder. It has folders like css, gallery, js and SuperScrollorama.jquery.json . Please have a look at the content of the folder here.

The superscrollorama website says I need to first link in jquery CDN and then embed Maxtween.js ans superscrollorama file.

I'm just skeptical how to add these files in wordpress. Do I put these in functions.php and how do I put it using wp_enqueue_script or wp_register_script.

I added this code in functions.php but it is giving me an error in my dreamweaver.

wp_enqueue_script('tween.max', 'http://cdnjs.cloudflare.com/ajax/libs/gsap/1.9.8/TweenMax.min.js'__FILE__); ?>

(I placed the superscrollorama zip folder in my wordpress plugins folder)


pescadito01 on "export large attachements"

$
0
0

- i have near 8000 attachment and i want to export only attachments
- when i export all content the export stop when the exported file arrive near 16 Mb. the xml file isn't propertly closed.
- same occurt if i use wp-export-attachments plugin

Please, how can i do a wordpress xml export for a large number of attachments (more than 13 Mb)?

best regards, pescadito

Kolokial on "Automating Theme Update"

$
0
0

Hi Guys, I've been working on an automated theme updater for some private themes, and would like to know if there is a particular criteria I need to meet before I can overwrite a theme.

I've searched the WordPress codex for such things, and was wondering if there was a hook or an action I needed to call before it was safe to do so. It seems a little easy that overwriting the theme accomplishes the task.

eitex on "Conditional Show Dates on Posts"

$
0
0

I would like to show the date and title on all blog posts, except where post_type='resources'. On 'resources' I would like to show no date and title.

I am modifying single.php but unable to get it to work.

The original code looks like this:

<header>
<?php $post_meta = of_get_option('post_meta'); ?>
<?php if ($post_meta=='true' || $post_meta=='') { ?>
<div class="post-meta">
<time datetime="<?php the_time('Y-m-d\TH:i'); ?>"><span><?php the_time('d'); ?></span><?php the_time('M'); ?></time>
<div class="extra-wrap">
<h4>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></h4>
<?php _e('Posted by', 'theme1559'); ?> <span class="author"><?php the_author_posts_link() ?></span>
</div>
<?php comments_popup_link('No comment(s)', '1 comment', '% comment(s)', 'comments-link', ''); ?>
</div><!--.post-meta-->
<?php } ?>
</header>

I tried changing it to this:

<header>
<?php if ($post_type<>'resources' || $post_meta=='true' || $post_meta=='') { ?>
<div class="post-meta">
<time datetime="<?php the_time('Y-m-d\TH:i'); ?>"><span><?php the_time('d'); ?></span><?php the_time('M'); ?></time>
<div class="extra-wrap">
<h4>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></h4>
<?php _e('Posted by', 'theme1559'); ?> <span class="author"><?php the_author_posts_link() ?></span>
</div>
<?php comments_popup_link('No comment(s)', '1 comment', '% comment(s)', 'comments-link', ''); ?>
</div><!--.post-meta-->
<?php } ?>
</header>

I have tried several different ways in fact but just cannot get it to work.

Any help would be appreciated.

sangfroidweb on "Permalink with arbitrary info?"

$
0
0

I need a permalink ninja! Let's say I have 2 custom post types authors and books. Within books I have a custom field, which let's you set the author of the book. In an ideal world, author would just be a taxonomy for books, but I needed a lot more robustness for authors than the normal taxonomy features in wordpress will allow, so I had to make it a custom post type to take full advantage of all the "post" features. Additionally author had to have a whole lot of it's own taxonomies... anyway.. all that works. Yay.. Great.. the problem is... I need to find a way to hack the author into the permalinks for the books... crap. I tried and I just don't have the chops. The whole rewrite rules code makes me dizzy. I feel like this should be possible... I'm just too dizzy... so what I'm looking for is:

http://www.mysite.com/books/j-r-r-tolkien/return-of-the-king/

the j-r-r-tokien part is from the custom field in the book custom post type... get it?

Please help! If you are out there, secret permalink ninja, and can solve this, I'll definitely throw you a bone!

cocoonfx on "Post Content to show in Fancy Box"

$
0
0

Hi

I have an interactive map powered by Jquery and I want to be able to show a list of post types per region. When you click on the post type title I want a fancybox to open with the post content. For some reason I can't see away to add the fancybox to the permalinks.

My code is as follows:
header.php

<script type="text/javascript">
$(document).ready(function(){
$('.fancybox).fancybox();
});
</script>

content-page.php

<li id="midlands">
<?php page_query = new WP_Query('category_name=midlands&post_per_page>=1') while ($page_query->have_posts()): $page_query->the_post();?>
<a class="fancybox" href="<?php the_permalink();?>"<?php the_title();?>?><?php the_title();?</a><br/>
<?php endwhile: wp_reset_postdata();?></li>

I have tried everything and I can not get it to work. I can get a link without a permalink to display the page content the links on but I not able to pull the content from a post.

Luismin on "Labels include"

$
0
0

Hi.

I would like to create a labels.php file to change the labels values from my WordPress backend.

I have a labels.php that I include in my functions.php.

Now, in one of my custom post type I want to add the variable instead of the static names. e.x.

function my_custom_post_textpages() {
	$labels = array(
		'name'               => _x( 'Description Texts', 'post type general name' ),
		'singular_name'      => _x( 'Description Texts', 'post type singular name' ),
		'add_new'            => _x( 'Add New', '' ),
		'add_new_item'       => __( 'Add New Description Text' ),
		'edit_item'          => __( 'Edit Description Text' ),
		'new_item'           => __( 'New Description Text' ),
		'all_items'          => __( 'All Description Texts' ),
		'view_item'          => __( 'View Description Texts' ),
		'search_items'       => __( 'Search Description Texts' ),
		'not_found_in_trash' => __( 'No Description Texts found in the Trash' ),
		'not_found'          => __( 'No Description Texts found' ),
		'parent_item_colon'  => '',
		'menu_name'          => 'Description Texts'

In order to change the menu_name I put in my labels.php define($backendMenu,"Title 1"); so I would put $backendMenu instead of 'Description Texts', but nothing happens. How can I load the $backendMenu value?

Thanks

ChetanTiwari on "Permalink in wordpress"

$
0
0

Hi All,

How can I rewrite a permalink in wordpress
I want to use user login name in wordpress url.

domain-name/page-name/uname/user_login i.e

domain-name/page-name/variable-name/value-of variable

or

domain-name/page-name/user_login i.e

domain-name/page-name/any-value

In place of

domain-name/page-name/?variable-name=value-of-variable

Can anyone help me out?

Thanks in advance


eternal403 on "how to invoke wordpress API from other existing PHP system"

$
0
0

I have an existing PHP site located on

/var/www/A
, now I want to add a blog module on
/var/www/A/wordpress
. I have installed wordpress below
/var/www/A
successfully. I can visit it via
http://localhost/mysite.com/www/wordpress
.

What I will to do next is : when a user regist on my site, at the same time create a new user in wordpress, so I need to invoke wordpress's API, and I found one wp_insert_user . I have a User.php and have a login function and I'll put the function wp_insert_user into it.

Fisrt, import API, I added these two lines on the head of my User.php.

define('WP_USE_THEMES', false);
require('/var/www/A/wordpress/wp-blog-header.php');

Then, visit my site via browser. Befor I include two lines, I can via

http://localhost/mysite.com/www/logon.php
to logon my site. But, after I added two lines, when I visit my site , the url are changed from
http://localhost/mysite.com/www/logon.php
to
http://localhost/mysite.com/www/logon.php/wp-admin/install.php

I notice that I have 'wp-admin/install.php' on my url, but I have been installed it and I can visit it via

http://localhost/mysite.com/www/wordpress

What a worese, all the style of my logon.php are completely different.
What should I do next ? Thanks in advance.

Bubbajuju on "Add Classes or Id's to Related Author Posts Code"

$
0
0

I am trying to understand how to add a class to php so I can then style it with css.

Here is the code I am working on. I would like to style the post name and the thumb.

Thanks for any help as usual...

function get_related_author_posts() {
    global $authordata, $post;

    $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) );

    $output = '<ul>';
    foreach ( $authors_posts as $authors_post ) {
        $output .= get_the_post_thumbnail($authors_post->ID);
        $output .= '<li><a href="' . get_permalink( $authors_post->ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></li>';
    }
    $output .= '</ul>';

    return $output;
}

Bellu on "Split Plugin code on multiple pages"

$
0
0

I'm developing a little plugin and i want to split the code in multiple pages.
At the moment i have only one PHP file in my plugin's folder.
I need to split the plugin like i can do when i develop a wordpress template.

I need something like this:
- my plugin folder
->my-plugin-main-file.php
->my-plugin-single-item.php

How can i define this?

Sorry for my english and thank you for helping me.

krzysiekkcn on "Modyfing wordpress searcher"

$
0
0

Hi!,
I would like to modify my search results on my blog.

In pages section I have templates like: smaller, fullwidth and show.
In side them I have some content. In smaller and fullwidth templates I have casual text, but the SHOW templates including my tags like:
[readthis]blablabla[/readthis] or others - inside the templates file, I'm using some php code to show it specialy. It's required to use this code.

But when I'm serching something my results looks horrible.
smaller and fullwidth are ok, but show template is displaing my tags ;)

I would like to hide content when in search results is page with show template, or show just the [show] tag.

I do not know how to check if the query in my while loop is using SHOW template.

Thanks in advance,
I'm waiting forward for your reply.
Greetings

crzy4prple on "calling shortcode in my jquery"

$
0
0

I'm using the hoverall script to display the simple site listing.

I need to call this script in the footer

<script type="text/javascript">
$(window).load(function () {
$('#comp1').HoverAlls({tooltip:true,starts:"-100px,-20px",ends:"-100px,5px",returns:"-100px,-20px",bg_class:"tooltip4background",speed_in:1000,speed_out:380,effect_in:"easeOutBack",effect_out:"easeInSine",bg_width:"400px",bg_height:"325px",html_mode:"#ceo"});

replacing #comp1 with [staff-name]and #ceo with [staff-position] which normally I would call as <?php echo do_shortcode('[shortname]'); ?>, but that doesn't work with the script.

I'm using my function.php in my child them with it being added to wp_footer. I just can't get the translation of the php part right.

TIA!
Anne

Viewing all 8245 articles
Browse latest View live




Latest Images