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

vphat28 on "Hi can I customize the url of custom post?"

$
0
0

Hi wordpress experts. I'm new on WP and got a quite hard requirements.

I have a custom post type name "del1" and I need a list page like this

{root_url}/del1/

and a detail page like this

{root_url}/del1/1-{post_id}


paqui on "how to include content of one page in another one ? (from title)"

$
0
0

This code is used to include the contents of a page in another from the ID.

<?php
$args=array(
  'page_id' => 893,
  'post_type' => 'page',
  'post_status' => 'publish',
  'posts_per_page' => 1,
  'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    <?php
    the_content();
  endwhile;
}
wp_reset_query();  // Restore global post data stomped by the_post().
?>

I would like to do the same but from the title.

Thinks

groncali on "appointment booking plugin with a credit system"

$
0
0

Hi Matt,

you could use Bookeo online bookings (http://www.bookeo.com), where you can assign credits from the back end, that can be redeemed against online bookings.

We do have a wordpress plugin.

Feel free to visit our website or send us an email at help@bookeo.com if you have any question.

Giovanna Roncali
Bookeo online bookings

Richard Leishman on "Message You suck! Go hack someone else."

$
0
0

I have been developing a plugin over the last 6 months which now has almost 40,000 downloads and some great feedback, it is a great experience and although I classed myself as an advanced PHP developer when I started; I have learnt so much from other developers who have emailed me with code suggestions and fixes.

http://wordpress.org/plugins/mail-subscribe-list/

I have a small problem that I cant seem to get my head around, a very small number of people have messaged me (5) saying that they get a message when they use my plugin which says "You suck! Go hack someone else.", I can not work out how this is happening and with my plugin being so simple I decided to google and noticed that there are a small number of other WordPress plugins that are displaying the same message.

Can anyone help or give any guidance?

otzined on "WP-print - get_attachment shows all images from Media folder"

$
0
0

Hi,

WP version: 3.5.1
WP-print version: 2.52.

For a website I am building I use WP-print. I want to show images from a gallery that's
inside the post. To show the images on the WP-print page I use wp_get_attachment_image, but it shows all the images from the Media folder and not just the attachments from the post.

Current code:

<?php
$gallery = get_children( 'posts_per_page=-1post_type=attachment&post_mime_type=image&post_parent=' . $post->ID );
$attr = array(
    'class' => "attachment-$size wp-post-image",
);
foreach( $gallery as $image ) {
     echo '<a href="' . wp_get_attachment_url($image->ID) . '" rel="gallery-' . get_the_ID() . '">';
     echo wp_get_attachment_image($image->ID, 'thumbnail', false, $attr);
     echo '</a>';
}
?>

Although I am using post_parent=$post->ID it shows all the images from the media folder and not only the attachments from the post.

Hope somebody can help me with this. Struggling with it for a while now.

mrfraz on "echo wp_get_attachment_image"

$
0
0
foreach ($files as $att) {
 echo wp_get_attachment_image($att); }

Need a little help.. for if empty..
echo.. nothing.

Thanks!

Binary12 on "Responsive problem and how to set page end"

$
0
0

Hello! I'll try to describe my two questions in more detail.

I've got my site http://www.fcdesign.se running a customized Balloons theme. I've added a picture to the page instead of the balloons, the picture is now (finally) responsive to the browser window. However, when you drag the browser window to very narrow (like a cellphone display) the navigation bar jumps down and leaves a big empty space above it. Can anyone explain why this happens and how to prevent it?

I have added a footer with social media icons in the bottom right corner, thing is I want the page to end where the text "Powered by wordpress....." is. Basicly, the social media footer could never go below that line. How can I do this?

Any help appreciated!

Best,
Fredrik

shihabmalayil on "What Error in my Slide Menu"

$
0
0

Hi, this is one Slide Menu tutorial, i need to use it in my wordpress blog as sidebar.only i need right side menu.
Header


<script src="<?php echo get_template_directory_uri(); ?>/js/classie.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/modernizr.custom.js"></script>

Template page
<div class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id="cbp-spmenu-s2"></div>
<button id="showRight">Show/Hide</button>


<script>
var menuRight = document.getElementById( 'cbp-spmenu-s2' ),
	 body = document.body;
showRight.onclick = function() {
	classie.toggle( this, 'active' );
	classie.toggle( menuRight, 'cbp-spmenu-open' );
	disableOther( 'showRight' );
			};
	if( button !== 'showRight' ) {
	classie.toggle( showRight, 'disabled' );
				}}
</script>

Everything showing, but no sliding animation. What codes i have to use to get the same slide menu animation ?. -Thank You-


mridl200 on "Auto Login using Cookies"

$
0
0

Hi Guys,

I've been trying to find a plugin or a way to allow users to be automatically logged into Wordpress through a forms auth cookie. At the moment my site accepts a cookie from another site and uses that cookie to display content but id also like to auto login the user as I stated.

Is this possible? and if so are there any resources that may assist me with what I am trying to do? I have googled a few methods but was unable to find anything concrete.

Thanks,
Mike

zmaj123 on "When I open the tag get a 404 error"

$
0
0

Hello,

I have a website for movies. I made a tag function imdb rating that looks like this:

// Add new "IMDB" taxonomy to Posts
    register_taxonomy('imdb', 'post', array(
        // Hierarchical taxonomy (like categories)
        'hierarchical' => false,
        // This array of options controls the labels displayed in the WordPress Admin UI
        'labels' => array(
            'name' => _x( 'IMDB', 'taxonomy general name' ),
            'singular_name' => _x( 'IMDB rating', 'taxonomy singular name' ),
            'search_items' =>  __( 'Search IMDB rating' ),
            'all_items' => __( 'All IMDB rating' ),
            'edit_item' => __( 'Edit IMDB rating' ),
            'update_item' => __( 'Update IMDB rating' ),
            'add_new_item' => __( 'Add new IMDB rating' ),
            'new_item_name' => __( 'Add new name' ),
            'menu_name' => __( 'IMDB rating' ),
        ),
        // Control the slugs used for this taxonomy
        'rewrite' => array(
            'slug' => 'imdb', // This controls the base slug that will display before each term
            'with_front' => false, // Don't display the category base before "/locations/"
            'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
        ),
    ));

To print tags using this code:

<?php the_terms( $post->ID, 'imdb', '<span>IMDB ocjena:</span> ',',','/10<br />' ); ?>

IMDB rating is printed, but when I open the tag get a 404 error. As if the tag does not exist.

While the functions of tags, which is the default in WordPress works. There I put tags actors and opens it.

Sorry for my bad English

cgrabe on "Remove specific key from array"

$
0
0

My have an event driven site and some of our events are hosted on meetup.com as well. I currently have the attendee list from meetup being merged with the attendee list on my site.

The issue is my RSVP will appear twice since I am on both lists. When the meetup list is being added to my site, I would like to prevent my information from being displayed based on adding that ID to a custom field in my event.

Any help would be greatly appreciated. My code is as follows:

/* load Meetup attendees - code starts here */
	$MEETUP_API_KEY = "b3d07b1b40124b62694a16255445b";		/* UPDATE WITH YOUR MEETUP API KEY */
	$ar_MeetupId = get_post_custom_values("Meetup ID");				// fetch the Meetup ID attribute values
	$meetupId = $ar_MeetupId[0];

if($meetupId!='') {			//	 if a Meetup Id is assigned to the event load attendees from Meetup.com
		$URL = "https://api.meetup.com/2/rsvps?&sign=true&event_id=" . $meetupId . "&key=" . $MEETUP_API_KEY;
		$cURL = curl_init();
		curl_setopt($cURL, CURLOPT_URL, $URL);
		curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, 0);
		$json_string = curl_exec($cURL);
		$response = json_decode($json_string, true);
		$count = $response['meta']['total_count'];		// find total count of attendees

		for($i=0;$i<count($response['results']);$i++) {
			$is_attending = $response['results'][$i]['response'];
			if(strtolower($is_attending) == 'yes') {		// only display attendees who have accepted to attend the event

				if($response['results'][$i]['member_photo']['thumb_link']!='')			// if a thumbnail image is available display it in 50x50
					echo '<div style="width:16em; float:left;"><div class="avatar"><div style="float:left; width:5em; height:5em;"><img src="' . $response['results'][$i]['member_photo']['thumb_link'] . '" width="3.75em" height="3.75em" style="width:3.75em;height:3.75em;"></div></div>';
				else
					echo '<div style="width:4em; float:left;"><img src="/nophoto.jpg" width="3.75em" height="3.75em" style="width:3.75em;height:3.75em;"></div>';

				echo '<div style="width:11em; float:left;"><h6>'. $response['results'][$i]['member']['name'] .'</h6></div>';

				echo '<div style="width:2em; float:left;"><h6>(' . ($response['results'][$i]['guests'] + 1) . ')</h6></div>';

				echo '<div style="width:10em; float:left;">&nbsp;</div></div>';

			}
		}
	}
	/* load Meetup attendees - code ends here */

Sidu_88 on "Category sidebar for single posts belonging to their category"

$
0
0

Hi everyone

I'm fairly new to WordPress (and Php programming) and I’m trying to call a category sidebar for single posts that are listed under that particular category. Lets say a single post ‘Diet Coke Is Awesome’ pulls a sidebar assigned to category ‘Cold Drinks’.

The other issue is what happens when single posts are listed under more than one category ? Lets say a single post ‘Diet Coke Is Awesome’ also happens to be listed under categories ‘Cold Drinks’ and 'Discount Supplies' where ‘Cold Drinks’ and 'Discount Supplies' are equal and separate in terms of hierarchy.

I have sidebar files and implemented them to Categories. I would like to do the same to single posts. Any Insights will be greatly appreciated.

http://www.espenvogel.com
Thanks

sblomberg on "Feature Pointer Alternatives"

$
0
0

According to this ticket comment by a WordPress dev, the WordPress core "feature pointers are designed only for internal pointers."

I would like to know if the WordPress team or other devs have alternative recommendations for alerting WordPress users of new plugin features. Thanks!

DaveWP196 on "profile_update action - what is its status?"

$
0
0

Has this action been depreciated or not in wordpress 3.4?

If it has been depreciated, what action/filter can be used to track ALL changes to the user object model made using the wp_user_update function? [I want to audit all changes made by Users to their registration details.]

tiszenkel on "Passing value to profile_update hook"

$
0
0

I feel like this is going to be a simple question for someone here, but I've been struggling with it on and off for days.

I'm adding a profile_update action to WordPress through my theme's functions.php file. I have custom radio buttons set up as part of my site's registration process through a plugin, Cimy User Extra Fields. If the user has selected one of the radio buttons, I want to perform a certain action on a profile update. When the user has selected the other, I want to perform a different action.

This works well if the user is updating an existing profile. But I want it to work on initial registration as well, and the call to the custom radio buttons don't return anything at that point. How can I pass a value to the profile_update function in such a way that I can test for it?


jspitz725 on "save_post & post_status help"

$
0
0

Hi,

I'm trying to get the post_status of a post before it is updated in the database. If I hook into save_post, I'm hoping that the post_status will have already been changed to publish. Am I correct?

Essentially, I have this hack where I modify the post content, but only when a post is published or updated. I don't want to modify the post content if the post is a draft or a preview or anything of that sort.

How can I check this on the fly? I've tried get_post_status(''), but let's say I'm working on a draft...get_post_status('') == 'draft' and when I click publish, my code still considers it as a draft until the page gets refreshed (then it considers it as published).

Sorry for the confusing question and thank you in advance for any help. I can clarify any questions.

Thanks

queengab on "Create plugin to export comments on csv file"

$
0
0

Hi to all,

how are you? I'd like to create a plugin that export my wp comments on one csv file.
I don't find any plugni that do this job for me.
I want to proceed ad:
Create on functions.php a function that retrieve my data or a db view that join wp_comments e wp_metadata to have all comments and related data to one file, than create a new menu iteam on the dashboard with a export button that call this function and save file?

Is it possibile?

Thanks very much
Gabriele

EightN9ne on "Woocommerce force shipping country by WPML"

$
0
0

I have a woocommerce store and it runs WPML so I can have different prices for Canadian or American customers because of different warehouses and costs.

It works great it changes the price and depending on if they select the US or CAN store but my problem is people in the US store can still select to ship to Canada and vice versa.

I need to change the code so that if they are in the "Canadian Store" (in other words they have Canada selected as their language) they can only select to ship to Canada and the same for the US store.

Can this be done by adding a php if statement to woocommerce-template.php where the below code normally is that basically says if WPML is set to US then the only country option is United States else the only option is Canada? If so what would the code be?

<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" class="country_to_state country_select" ' . implode( ' ', $custom_attributes ) . '>
<option value="">'.__( 'Select a country&hellip;', 'woocommerce' ) .'</option>';

   foreach ( $woocommerce->countries->get_allowed_countries() as $ckey => $cvalue )
   $field .= '<option value="' . $ckey . '" '.selected( $value, $ckey, false ) .'>'.__( $cvalue, 'woocommerce' ) .'</option>';

$field .= '</select<>';

NVZ on "username_exists does not work with special chars"

$
0
0

Hi there,

I may have stumbled upon a bug in the wordpress system. I have a script were i need to check the username before adding it with wp_insert_user.

In wp_users i have a user with a user_login value of: Cafe t test

When i try to insert the following username in wp_insert_user the wp_error tells me that the username exists already: Café 't test
That seems to be correct, so i need to check the value before adding with username_exists(). But that function returns null.. ?
When i remove the accents and the quotes both functions tell me the username exists. But in my opinion, the username_exists functionn should do that by default.

yalrighty on "Woocommerce and Open Graph meta tags"

$
0
0

Greetings,

I am a dummy when it comes to php code. I get by alright on my own but I'm definitely no expert.

I have 3.5.2 and woocommerce 2.0.12.

I am using a combination of itthinx.com's open graph protocol plugin and the Wordpress Social SEO booster plugins to generate various open graph tags that I need for certain functions I am using with social media sites. But one of the tags I need generated is for the price so that the store qualifies to use Pinterest's Rich Pins. I have every tag I need by modifying code here and there.

I need one more tag to generate for price which would look like this

<meta property="og:price:amount" content="15.00" /> where 15.00 would be the price of the product being viewed.

It must be something simple but I am unfamiliar with using hooks and pretty new to WP itself. Any help would be greatly appreciated.

Viewing all 8245 articles
Browse latest View live




Latest Images