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

ahmadaziz0441 on "How do i categorise the category?"

$
0
0

Hey guys, i wanted to know how we can categorise the category, well in wordpress this tool is not available.. but maybe we can create our own codes/plugins to achieve this.

I wanted to categorise the category and the category are the name of my tutorial series ex(HTML) and for the category child i will use it for the series number ex(HTML series 1, HTML series 2). With categorise the category, i can than categorise HTML as ex(programming, web-tools, etc) .. anyone know how to do this?.. Thank you

:)


waltervos on "Fetching serialized post_meta fields with XML-RPC"

$
0
0

Hi,

I've got a scripts regularly downloading a listing of posts (from a custom post type) and some associated post_meta via XML-RPC. All was working fine, until I wanted to include an additional field which happens to be stored in a serialized form. This field is never included in the response. How can I get this field to be included as well?

Some additional info: I don't know if this makes a difference or not, but I thought I'd also add that this field does not (necessarily) exist for all posts in the set.

SauLustig on "Embed Picture"

$
0
0

I am trying to explain my problem.

Users can generate pictures on my page and share them on social media platforms.

If anyone clicks the pictures from there, they get to the total link of this picture.

E.g. http://saulustig.com/test/picture1.jpg

My problem here is, that no sees that this picture is originally from my page. They see the picture and yes of course the link, but no one will ever visit my page after that!

My question: Is there a Plugin or a hack, when you click on this link to the picture, that this picture might be shown inside the theme?

I hope you know what I mean...

This would be so helpful 4 me!
Thx 4 your help!

mehdimor on "Secure wp-admin"

$
0
0

Hi,
I'm using a plugin that is showing me how many people failled to login as administrator and they give me they country (especialy from italy).

I would like to know how to protect my login page or restrict just connection from my country to login as administrator.

Help me please.
Thank you

valdirljr on "Add title tag inside the gridview , in media library"

$
0
0

Hi,

I trying to add the tag title in Grid View, when i'm in media library.
I see in wp-includes/js/media-view.js, line 4629, when this js gets the title. I will not edit the core of WP, but i tested it with :
'title': this.model.get( 'title' ),
and works fine. There is a better way to make what i want?

Greets

kieranreeves on "wordpress get_field IF statement"

$
0
0

<li><span class="icons orange fa fa-check"></span><?php echo get_field("reason_6"); ?></li>

How can i get the above line into an if statement where if the field is empty it doesn't display but if there is something in there then it displays on the page. Im new to PHP so would like to know.

yekxmerr on "Need Help on WP_Query"

$
0
0

Hello,

I've been struggling to get a custom wp_query for my new template and i need your help.

On the single.php, i need to display the previous published post (based on the current post date) from the same category.

I dont know if this makes sense but here it goes on a simple version:
On the 24th i publish post 1 2 3 4 5 6 on the category X, and what i need to do is:
- On the post 2 display the post 1 from category X, on the post 3 display the post 2 from category X, on the post 4 display the post 3 from category X, etc..

Thanks in advance.

AA88 on "Albums and Sub Albums"

$
0
0

Is there a way to have sub albums be listed in a parent album and only display parent albums on the main page until the user clicks the parent album they want to view? Then the sub albums will display on the other page which is linked to that parent album and when the user selects one of the sub albums it goes to projects page .
I created all the pages and it's all static design,I created a page called Projects.php,subalbum1_1.php and album1.php, and just linked them,but the problem is when I add a new category I have to make a new php page and I have to do that even for the sub albums because every album and sub album includes their posts. but is there an automatic way to do that? i read other topics related to this and they recommend plugins to use, can I do that without using plugins?
tnx


Ivan Privalov on "[Plugin: Events Manager] Define Event Manager categories"

Gueno87 on "Modification Mantra Portfolio Metro Wordpress theme"

Pete on "How to convert this snippet to taxonomies instead of categories"

$
0
0

Hi...
How would I change this snippet of code so that it outputs a list of the child taxonomies from the current custom parent taxonomy rather than categories.

This will be outside the loop in taxonomy.php

<ul>
<?php
	{ $cur_cat = get_query_var('cat');
		if ($cur_cat)
		{ $new_cats = wp_list_categories('show_option_none=&echo=false&child_of=' . $cur_cat . '&depth=1&title_li=&show_count=1&hide_empty=1');
			echo '' . $new_cats . ''; } } ?>
</ul>

joshjosh on "Permanently hide post from logged-in user once user has viewed it a single time?"

$
0
0

Hello, all. I'm looking for a methodology that would result in a post being permanently hidden from a specific user who logs-in and views the post once. I want the post to disappear after the user has left the page, or after a specified period of time after the post has been viewed. Any ideas?

Alternatively, allowing the user to click a button to hide the post permanently would also suffice.

Josh

MTWK-IDG on "jquery .position().top undefined when in wordpress"

$
0
0

I've built a content slider that works perfectly on my local computer but within wordpress it's stumbling on the following:

var begin_position = jQuery("#individual_story_wrapper").position().top;

I'm getting the follow error:
: jQuery(...).position(...) is undefined

Yet locally, the slideshow runs fine and I can see the position being changed as I animate the individual_story_wrapper up and down.

The only difference that I can see is the link to the google hosted jquery. Otherwise, everything is the same.

ikkes23 on "Product categories ordered by..."

$
0
0

Hey guys!

I am creating a webshop using wordpress and woocomerce and now I am introducing the product categories widget in the shop section and I would like them to be ordered differently than they are now.

http://oi58.tinypic.com/30cyql2.jpg
This is a print screen of how they look now. I would like them to be presented in this way: Scale 1/48 Scale 1/72 Scale 1/144.
How can I order them as I want?

guarriman on "How to handle the domain of the petitions (editing 'index.php'?)"

$
0
0

Working with WordPress 4.0.1., I'm trying to handle the domain of the petitions.

For that, I started to edit the file 'index.php' of my theme, and

print "My domain is: " . $_SERVER['SERVER_NAME'];
exit();

Unfortunatelly, no message is displayed. In fact, if I write wrong code, I get no error.

Which file must I edit? Thank you veyr much.

PS: I got my 'W3 Total Cache' deactivated.


dhirlinger on "get attachment post id to display attachment custom field data"

$
0
0

Firstly, I know that this question or those similar to it have already been asked. And yet I have been banging my head against the wall on this for days. Thus, I am posting my first question.
I have created a custom field for attachment images, for a custom post type, using the extremely helpful tutorial on the process by Andy Blackwell (It is here) employing the attachment_fields_to_edit and attachment_fields_to_save hooks just as he does. I can see that the data makes it to the data base and that it shares the same post id there as the image it is paired with. However, I can not get the data, which for now is simple text, to display with the image. In my plugin I have used the img_caption_shortcode hook to add another figcaption tag and I have tested it with text rather than a variable to make sure that aspect is working - and it is. Additionally, when I type the post id directly into get_post_meta the text also displays. So, I know that my problem is passing the correct id. Never the less I have not succeeded! Your help is greatly appreciated.

Below is my code. $dpi is where I want to store the needed data.

function my_image_attachment_fields_to_edit($form_fields, $post) {
    // $form_fields is a special array of fields to include in the attachment form
    // $post is the attachment record in the database
    //     $post->post_type == 'attachment'
    // (attachments are treated as posts in Wordpress)

    // add our custom field to the $form_fields array
    // input type="text" name/id="attachments[$attachment->ID][custom1]"

if( substr($post->post_mime_type, 0, 5) == 'image' ){

	$field_value = get_post_meta($post->ID, "_custom1", true);
	$form_fields["custom1"] = array(
        "label" => __("300dpi Image Name (include extension)"),
        "input" => "text", // this is default if "input" is omitted
        "value" => $field_value ? $field_value : ''
    );
    // if you will be adding error messages for your field,
    // then in order to not overwrite them, as they are pre-attached
    // to this array, you would need to set the field up like this:
    //$form_fields["custom1"]["label"] = __("Custom Text Field");
    //$form_fields["custom1"]["input"] = "text";
    //$form_fields["custom1"]["value"] = get_post_meta($post->ID, "_custom1", true);

    return $form_fields;
	}
}
// attach our function to the correct hook
add_filter("attachment_fields_to_edit", "my_image_attachment_fields_to_edit", 10, 2);

/**
 * @param array $post
 * @param array $attachment
 * @return array
 */
function my_image_attachment_fields_to_save($post, $attachment) {
    // $attachment part of the form $_POST ($_POST[attachments][postID])
    // $post attachments wp post array - will be saved after returned
    //     $post['post_type'] == 'attachment'
	;
//if( substr($post->post_mime_type, 0, 5) == 'image' ){

	if( isset($attachment['custom1']) ){
        // update_post_meta(postID, meta_key, meta_value);
        update_post_meta($post['ID'], '_custom1', $attachment['custom1']);
    }
    return $post;
//}
}

add_filter( 'attachment_fields_to_save', 'my_image_attachment_fields_to_save', 10, 2 );

add_filter( 'img_caption_shortcode', 'my_img_caption_shortcode', 10, 3 );

function my_img_caption_shortcode( $empty, $attr, $content ){
$atts = shortcode_atts( array(
		'id'	  => '',
		'align'	  => 'alignnone',
		'width'	  => '',
		'caption' => '',
		'class'   => '',
	), $attr, 'caption' );

	$atts['width'] = (int) $atts['width'];
	if ( $atts['width'] < 1 || empty( $atts['caption'] ) )
		return $content;

	if ( ! empty( $atts['id'] ) )
		$atts['id'] = 'id="' . esc_attr( $atts['id'] ) . '" ';

	$class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );

	//$dpi code was here

		if ( current_theme_supports( 'html5', 'caption' ) ) {
		return '<figure ' . $atts['id'] . 'style="width: ' . (int) $atts['width'] . 'px;" class="' . esc_attr( $class ) . '">'
		. do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption>' .  '<figcaption class="dpi-link">' . $dpi . '</figcaption></figure>';
	}
}
?>

justawebbie on "getting different sidebars in footer"

$
0
0

I am new to WP but giving it a try on making my own child theme from Twenty Thirteen. I am trying to get a different sidebar for category, tag, and page. It does not work for the news category. I have this code in my footer, should i put it somehow in my functions.php? If so, would someone explain how to do that to me. Can you tell me what I did wrong please.

<?php if (is_home ()) {
		get_sidebar( 'main' );
	} elseif (is_category('events')) {
	        get_sidebar('events');
        } elseif (is_category('news')) {
		if (has_tag('employee')) {
			get_sidebar('employees');
		} elseif (has_tag('student')) {
			get_sidebar('students');
		} else {
                        get_sidebar('news');
                }
         } elseif (is_page('Athletics')) {
		get_sidebar('athletics');
         }else {
                get_sidebar();
         } ?>

jack_10310 on "Display Title as Caption"

$
0
0

I almost a newby to wordpress and all the programing world but a person have asked me to make a page for her with all her products , the thing is , i need to show costumers the product code so they can buy it .
i´ve been really digging on this topic finding nothing but ERRORS when i tried to implement them so if someone could just help me.

achurch on "hack my subpages"

$
0
0

Hey guys… anyone know why the mobile version of my site has the subtitle "boîte de viagra"? That's not what is on the web and I need to remove it. Any suggestions?

keith_e on "Using $_SERVER['REQUEST_URI']"

$
0
0

Hi

I have two websites with exactly the same layout and structure, one is in English and the other is in French. I have put two buttons on each site to swap between the two. So if a visitor is on http://www.frenchsite.com/services and wants to go to the same page on the English site (www.englishsite.com/services), they click on the 'English' button.

I'm having difficulties with getting $_SERVER['REQUEST_URI'] to work properly.

I'm trying to use, for example, on the French site (www.frenchsite.com)
<a href="<?php ‘http://www.englishsite.com’.$_SERVER['REQUEST_URI']; ?>" id="flag"><img src="<?php bloginfo('template_url'); ?>/images/ausflag-50x25.png" title="English"></a>. to go to the equivalent page on the English site.

It doesn't construct the URL correctly. Instead it constructs http://www.frenchsite.com/services for example, rather than http://www.englishsite.com/services.

Some help please?

Cheers
Keith

Viewing all 8245 articles
Browse latest View live




Latest Images