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

starflamedia on "How to use relative paths that would work after launch?"

$
0
0

Hi All!

I am a big fan of relative paths and no matter what anyone says I will go on looking for cleaner, shorter code no matter what.

When I build a WP site in development environment including local server on my computer or a beta folder under my future domain name, I use images in my posts by ftp upload in a folder called /images/ in the root directory of wordpress. This is so I do not type /wp-content/images, or anything else. It's just what i have assumed as the shortest code I can write like /images/image1.jpg.

How can i and why doesn't WP recognize a path as follows "/images.filename.jpg" when the WP files are in a subfolder such as /beta/ or /test/? It keeps lookig for the images in the root directory of the path even when i have specified the WP folder is either /beta/ or /test/? None of my images would show unless I specify that temporary "beta" or "test" folder!

My workaround has been to add an /images/ and /img/ folders in the root directory of the server during development that I then copy to the specific WP folder right before launch.

None the less, it's been bugging me and it makes it difficult to work on several sites at the same time, since they would share those /images/ and /img/ folders.

Is there any way I can have either an htaccess redirect or WP setting where it would rewrite EVERY RELATIVE PATH WITHIN WP to the correct NEW path? I tried every suggestion for the htaccess that i could find and none have worked so far.

There's no way I will ever consider using the native media importer in WP - the sites I build often have thousands of products with multiple images each. I like to be organized.

The bottom line is - I want to upload my images with FTP and stick to a relative path!

Thank you!


Martin E on "Site hacked"

$
0
0

Hi, webmaster tools has notified me my site has been hacked. There's now a pornographic cam link off screen just above the entry content. I've changed passwords immediately. Can someone tell me how I can find this and remove it? Thanks

Mark2122845 on "Website Hacked by Malacious Code"

$
0
0

http://americanlightworks.com/

Someone calling themselves has hacked my site

'Dear admin, you have a huge vulnerability. Email me:

[ Details redacted, why give that person airtime? ]

I reloaded 4.0.1 - no change.

jim2k on "Show related posts by category"

$
0
0

Is there a simple, plugin-free way of showing a number of related posts from the same category on the single.php page (without showing the current post as part of the list, of course)? Perhaps using wp_query?

I've tried a bunch of things and the tutorials out there are all several years old and don't really work.

Thanks in advance!

Number_6 on "Removing all taxonomy admin submenus"

$
0
0

Hello folks,

I have 6 post types and about 20 taxonomies relating to at least one of those post types. I find it easy to navigate the admin panel, but people who wish to work with me are intimidated by the visual pollution caused by the taxonomy submenus under each post type menu.

What generates these submenus and how could I efficiently omit them?

Ideally I'd like to give the taxonomies their own menu hierarchy, but I'll cross that bridge when I come to it.

Cheers.

Katrienmoore on "names for images with add media in posts and pages"

$
0
0

In posts or pages you can use the add media button. This opens a grid view of the media library but it does not show the names of theIimages. I have loads of similar images. I would need the names to be able to pick the right one. How do I display the names there or change the display to a list few

floreal on "Does a Wordpress XML-RPC librabry exists in Qt/C++ ?"

$
0
0

Hi,

I am developping an application that help me posting in my wordpress blog.

My application is written in Qt/C++. Before, I have created this application in Java, and I used JWordpress (https://code.google.com/p/wordpress-java/) for send post in my blog, through XML-RPC protocol.

Now, I am translating this application in Qt/C++ for many reasons (the main reason: Qt/c++ is more beautiful, and more fluent than java).

All work well with the Qt/C++ version, but I don't find any equivalent for Qt/C++ ?

I find qxmlrpc (https://code.google.com/p/qtxmlrpc/), but it use only basic xmlrpc protocol and is not specific to wordpress.

I don't understand a lot how this protocol works for wordpress, so I search a library already existing...

Do you know an appplication that can help me for that ? Or do you know a full detailled manual that can help me to make it ? Because I am a full noob in that domain...

Thank you in advance for your help.

Floréal.

lagoongear on "if increase the WP ram usage, can I click auto update without reset changes?"

$
0
0

Hi Guys,

I wonder, if I change the PHP wordpress coding to increase to ram to like 512MB.

If I click auto update, will it reset?

Or it depends the version update changes?


motp on "Two Factor Authentication With Missed Calls"

$
0
0

Hello Guys,

I have recently developed a wordpress plugin for implementing two factor authentication with missed call based tokens. The basic purpose is to build authentic user base ( by validating user's phone number but WITH MISSED CALL )

Here is how it would work.
1. User tries to signup / login / comment at abc.com
2. abc.com sends a missed call ( calls user and auto cuts the call)
3. User is asked to enter the caller id from which he / she received a missed call.
4. User enters the missed call number and thus verification done.

Here is a live demo of the same.
http://madmimi.com/p/c0b695/preview

Please provide your feedback and suggest me improvements / comments

kostas5001 on "pagination into a page"

$
0
0

Hello how to put pagination into a page?

Uriahs Victor on "WordPress Social Login"

$
0
0

When ever a user signs up using WP Social Login (i only use fb option for now) it automatically puts in an "_" in place of any spaces in their name. How can i prevent that and have their name show up exactly as it is on facebook?

Their "Name" is fine, but their "User Name" shows an "_" in place of a space.

E.g here

WinkingFrog on "Plugin resources not loading on repo version??"

$
0
0

Hi all, hoping someone can help me find an issue with a new plugin that I just got into the repo?

The plugin is 'WFS Let It Snow', it's really simple and works fine both locally and if I zip up my local trunk and upload it to a live site. However, if you install it through the Plugins menu it fails to load image and js resources in both admin and the frontend (leaving the plugin useless!).

The files are physically there, and when the code is inspected the urls to the resources are correct - but WordPress won't let them load! It strikes me as some kind of permissions or subVersion issue of some sort, but I am totally stuck as to where to start with it.

Can anyone spare a few minutes to educate me so I can get it working and know how to deal with this in the future?

gordon34 on "Deactive certain plugin on post edit screen"

$
0
0

is there any hook to deactivate (deregister or dequeue) certain plugins (which i choose) when I'm try to edit posts? I have plugin conflict and I want to deactivate one plugin when I edit custom post type items. Every other edit screens works without conflict. Any help will be appreciate.

greatdanemaniac on "Create a default title based on post format status and or aside?"

$
0
0

Hi!
I need help with this. I'd like to have a default title based on the post formats status or aside. Aka if I select the post format "aside" in the post format metabox, the title should automatically change to i.e "Update + date". If I select another post format, the title field should stay empty and I shall fill it in myself.

I have some basic code and this works as long as I do not add the post format stuff to it. I get a default title but it's stuck no matter what post format I choose. I only want this for the post formats I mentioned.

add_filter( 'default_title', 'my_default_title', 10, 2 );

function my_default_title( $post_title, $post ){

      if(has_post_format("aside"))
    {

	$title = "Update |";

  // create your preferred title here
  $post_title = $title . date( 'F j Y' );

}
  return $post_title;
}

The titles are not supposed to be shown on my blog. I only want this in order to have a unique permalink and title for each post, instead of some number if I forget or don't fill in the title myself. I know I can use wp_insert_post_data for this as well, but I haven't seen a single proper example of how to incorporate post formats into that code, and I've googled this problem for 3-4 days now and I'm getting nowhere.

I'm a complete noob, so please be thourough with your explanation on how to make this work. Thanks in advance!

Micx on "How collect data from checkout page which are not supported"

$
0
0

Hello everyone!
How can I collect data from radio buttons on checkout page which are not supported by woocommerce plugin?
Greetings


Saeed Salam on "Custom Calendar Widget"

$
0
0

Hello,

Am working on a site that lists historic moments.

it will have posts like "George Washington became the first president of USA on April 30, 1789"
it will be tagged with "April 30".

what i want to achieve is, when clicking on the April 30 in the Calendar Widget (on any year), it should open the archive page of "April 30" tag. is it possible? any plugin there to get it done? would be so grateful if someone can direct me to do it.

Thanks!

princessoffinland on "How to position my images at the same place in different browsers"

$
0
0

Hi everyone,

I've just built a blog on http://www.princessoffinland.com and I am almost happy with the general outlook of the site. The only thing I am missing, is social media links to Pinterest, Twitter and Instagram. I have uploaded 3 icons to my child theme and positioned them on the rigt side of my header, where I think they fit, when working in my computers browser.
Now I have two challenges, that I could use some advice for:

1. How do I make the three social media icons appear at the same place, when opening my blog on a tablet or my I-phone?
And by "same place" I mean:
- above the horizontal line that devides the header from the post area
- in line with my page titles
- ending (at the right side) at the same position as my tagline & the horizontal line

2. How do I add my links to my icons?

I would prefer the most simple solution, since I am just a beginner with WP, PHP, HTML etc.

Please feel free to take a look at my site and the following code from my header.php and style.css.

Cheers

This is my header.php:

<?php
/**
 * Template for site header
 * @package themify
 * @since 1.0.0
 */
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>

<meta charset="<?php bloginfo( 'charset' ); ?>">

<title><?php wp_title( '|', true, 'right' ); ?></title>

<?php
/**
 *  Stylesheets and Javascript files are enqueued in theme-functions.php
 */
?>

<!-- wp_header -->
<?php wp_head(); ?>

</head>

<body <?php body_class(); ?>>
<?php themify_base_body_start(); // hook ?>
<div id="pagewrap">

	<div id="headerwrap">

		<?php themify_base_header_before(); // hook ?>
		<header id="header" class="pagewidth">
        <?php themify_base_header_start(); // hook ?>
			<?php echo themify_base_site_title( 'site-logo' ); ?>

			<?php if ( $site_desc = get_bloginfo( 'description' ) ) :
				global $themify_customizer;
				?>
				<h2 id="site-description" class="site-description"><?php echo $themify_customizer->site_description(); ?></h2>
			<?php endif; ?>

			<nav>
				<div id="menu-icon" class="mobile-button"><i class="icon-menu"></i></div>
				<?php
				wp_nav_menu( array(
					'theme_location' => 'main-nav',
					'fallback_cb'    => 'themify_base_default_main_nav',
					'container'      => '',
					'menu_id'        => 'main-nav',
					'menu_class'     => 'main-nav'
				));
				?>
				<!-- /#main-nav -->
			</nav>

		<?php themify_base_header_end(); // hook ?>
		</header>
		<!-- /#header -->
        <?php themify_base_header_after(); // hook ?>

		<div class="social-icons">

 <a>
  <img src="http://princessoffinland.com/wp-content/uploads/2014/11/twitter12.png" width="25" height="25"/>
  <img style="padding-right:20px"/>
  </a>
	<a>
  <img src="http://princessoffinland.com/wp-content/uploads/2014/11/pinterest11.png" width="25" height="25" />
  <img style="padding-right:20px"/>
 </a>
 <a>
  <img src="http://princessoffinland.com/wp-content/uploads/2014/11/instagram13.png" width="25" height="25" />
  <img style="padding-right:20px"/>
</a>
</div>

	</div>
	<!-- /#headerwrap -->

	<div id="body" class="clearfix">
    <?php themify_base_layout_before(); //hook ?>

This is my style.css:

@import url("../themify-base/style.css");

.social-icons {
	float: right;
	margin-right: 17%;
	margin-top: -5.25%;
	padding-left: 20%;

	}

talk2ameya on "Facebook like button on homepage not expanding after click"

$
0
0

My website

I've put up the facebook like button (manually through code) beside the post date and comment count on the posts that are displayed on the homepage.

The button works perfectly, but when I click on it, it is ideally supposed to expand down fully to give me the option to add some text and post on facebook.

In my case, it expands, but only till the width of the button.
(You'll have to visit my site and see to understand what I'm talking about)

How do I get it to expand properly?

Here's my code in content.php:

<div class="entry-meta">
<?php hemingway_rewritten_posted_on(); ?>

<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>

<span class="comments-link"><span class="sep"> / </span>

<a href="<?php echo get_permalink($post->ID); ?>#fbcomments">
<fb:comments-count href="<?php echo get_permalink($post->ID); ?>">    </fb:comments-count>&nbsp;comments </a>

</span> <span class="sep"> / </span>

<fb:like href="<?php the_permalink() ?>" width="300" layout="button_count" action="like" show_faces="false" share="false"></fb:like>

<?php endif; ?>

<?php edit_post_link( __( 'Edit', 'hemingway-rewritten' ), '<span class="edit-link"><span class="sep"> / </span>', '</span>' ); ?>

</div><!-- .entry-meta -->

Muad_Dib on "Related posts for custom post type"

$
0
0

Hello everyone,

I have a problem that I am stuck with and I don't seem to find an answer to it. I have a website where I built a few custom post types to better manage my content.I also have a related posts plugin functionality bundled with my theme but for now it only displays related post from the default post type. I want it to display related posts based on the custom post type the article is in. How can I achieve something like this?

The code for the related posts function is this:

<?php
global $get_meta , $post;

if( ( tie_get_option('related') && empty( $get_meta["tie_hide_related"][0] ) ) || ( isset( $get_meta["tie_hide_related"][0] ) && $get_meta["tie_hide_related"][0] == 'no' ) ):
	$related_no = tie_get_option('related_number') ? tie_get_option('related_number') : 3;

	global $post;
	$orig_post = $post;

	$query_type = tie_get_option('related_query') ;
	if( $query_type == 'author' ){
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'author'=> get_the_author_meta( 'ID' ), 'no_found_rows' => 1 );
	}elseif( $query_type == 'tag' ){
		$tags = wp_get_post_tags($post->ID);
		$tags_ids = array();
		foreach($tags as $individual_tag) $tags_ids[] = $individual_tag->term_id;
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'tag__in'=> $tags_ids, 'no_found_rows' => 1  );
	}
	else{
		$categories = get_the_category($post->ID);
		$category_ids = array();
		foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'category__in'=> $category_ids, 'no_found_rows' => 1 );
	}
	$related_query = new wp_query( '&args' );
	if( $related_query->have_posts() ) : $count=0;?>
	<section id="related_posts">
		<div class="block-head">
			<h3><?php if(tie_get_option('related_title')) echo tie_get_option('related_title'); else _e( 'Related Articles' , 'tie' ); ?></h3><div class="stripe-line"></div>
		</div>
		<div class="post-listing">
			<?php while ( $related_query->have_posts() ) : $related_query->the_post()?>
			<div <?php tie_post_class('related-item'); ?>>
				<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
				<div class="post-thumbnail">
					<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
						<?php tie_thumb( 'tie-medium' ); ?>
						<span class="overlay-icon"></span>
					</a>
				</div><!-- post-thumbnail /-->
				<?php endif; ?>
				<h3><a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
				<p class="post-meta"><?php tie_get_time() ?></p>
			</div>
			<?php endwhile;?>
			<div class="clear"></div>
		</div>
	</section>
	<?php	endif;
	$post = $orig_post;
	wp_reset_query();
endif; ?>

Thank you very much for your help!

AliceWonderFull on "Prepared Statements"

$
0
0

http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

Says prepared statements require two arguments.

I don't understand something, it looks like it requires you to pass the argument at the time you prepare the statement?

in PDO you do something like

$sql = 'DELETE FROM ' . $this->sqltable . ' WHERE tid=?';
$q = $this->pdo->prepare($sql);

Then later you can use it by calling

$q->execute($arg)

You can't do that with WordPred $wpdb prepared statements? You have to know the argument(s) at the time you prepare it?

That seems wrong, what am I missing?

Viewing all 8245 articles
Browse latest View live




Latest Images