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

yboss on "Embed Category Search Into Page Loop issues"

$
0
0

Greetings WP community,
I've been playing with WP for a while now and I'm trying to create an 'events' page that will post wordpress posts from 'cat=4' or the events category. It is posting fine except for the issue that it is looping the posts over and over again infinitely. Is there a way I can loop this so it shows all category posts but doesn't repeat them? Thanks for all the help everyone!
-Yuval

<?php if (have_posts()) :  ?>
                    <?php while (have_posts()) : the_post(); ?>

                        <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix post'); ?> role="article">

                            <header>
                                <h2 class="line"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                            </header> <!-- end article header -->

                            <section class="post_content clearfix" itemprop="articleBody">
                              <?php
query_posts('cat=8');
while (have_posts()) : the_post();
the_excerpt();
endwhile;
?>

VicWarh on "Goodreads star rating system"

$
0
0

Is there anyway to implement it in a wordpress site?
Please advice,

Thanks

ti2m on "wp_mkdir_p not working"

$
0
0

Hi,
I've written the plugin Edge Suite which handles animations in form of OAM files, which are nothing else then ZIPs. I'm using the codex method wp_mkdir_p to create nested directory structures. Turns out some people have problems with it as it just fails. Any clue why that might be? It's really strange, this really common functionality is only being called 4 times in wp core, almost looks like devs know it doesn't work....

Am happy about any hints, as I can't reproduce the errors on my servers and it's therefore really hard to debug it.

bleggate on "retrieve multiple pages and posts/ category for Home page, using query_posts?"

$
0
0

Hi

I am wanting to feature on my home page only in an archive type feed, pages and posts (or a category) - using WordPress php and codex

this is the code I have worked on to date for the functions.php file of my theme

function child_before_loop () {
    global $query_string; 

    if( is_home() )
$args = array(
  'post_type' => 'page',
  'post__in' => array(19)
  );
$categoryvariable = $cat;
$args = 'cat=10' . $categoryvariable . '&orderby=date&order=ASC';
query_posts( $args );
} 

add_action('genesis_before_loop', 'child_before_loop');  

add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );

[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

I have also used this code below for categories only which works

function child_before_loop () {
    global $query_string; 

    if( is_home() )
    query_posts($query_string . "&cat=10");
    } 

add_action('genesis_before_loop', 'child_before_loop');  

add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );

[And again...]

so the challenge is how to call cat10 posts and page id 19 at the same time.

sure it must be simple but I am not seeing it.

thanks

icing on "Combining and Minifying CSS the right way"

$
0
0

I have read that combining and minifying CSS saves useful bandwidth and increases the general performance of the website. Most of the CSS Minify tools remove the commented out text from a CSS file. This is part of optimization as the browsers do not need that information.

But the problem here is that wordpress depends on some commented out text which lies on top of theme css file. Such as this:

/*
Theme Name: Response
Theme URI: http://cyberchimps.com/cyberchimps-free/
Author: CyberChimps
Author URI: http://www.cyberchimps.com/
Description: A Free HTML5 Responsive Drag & Drop Starter WordPress Theme by CyberChimps WordPress Themes featuring Twitter Bootstrap, and responsive touch friendly theme options.
Version: 2.1.6
*/

There is also a way to bypass this dependence using some php hacks. Minify WordPress theme stylesheets-Kuttler This is a post from Nicolas Kuttler from 2010. Now being 2013, I suppose there is another way to do this.

So, my question to you is:

  1. If the CSS header information is not there in the minified CSS, which will be served to the browsers. What php code should be added to functions.php of child theme, so that Wordpress doesn't break? Maybe using is_admin function.
  2. What code should be added to functions.php to serve style.min.css and not load the actual style.css?

moksh on "login in frontend"

$
0
0

i am using theme my login plugin. when any user login through login page it redirect to dashboard. so what changes i have to do to redirect them to another page?
mean i have to redirect them to edit profile page. what changes will i have to do and where?

bobspalding on "WP-E-Commerce Predictive Search Pro - Developer tells me to HACK"

$
0
0

Hi.
I asked a3Rev's support forums to add a Sort Results by variance (colour, size etc.) and sort results by price, a little bit like eBay, and my response was feel free to hack the the plugin to suit my needs and that a3Rev were not planning on adding such feature. This is fine accept how would I begin something so big? If anyone has pulled this off (or something similar) I would be grateful to know of your existence and if you are able to help then that would be greatly appreciated.

Please let me know how possible this is, and what I need to do.

Regards

frameitphoto on "Warning Error - creating default object from empty value"

$
0
0

My web host is forcing me to switch to PHP 5.4. I was on 5.3 and they won't force the switch until next April so plenty of time. Well I switched anyway (although I can go back). An got a problem.

I use the Pagelines Platform theme and two of it's PHP files are throwing errors and lots of them. I detail two below.

The first one throws the error on this line (there are quite a few like this):
$this->hidden->text = '';

The error is: Warning: Creating default object from empty value in /wp-content/themes/platform/includes/class.layout.php on line 167

So I found a way to fix it by adding this if statement before the lines like:

if (!is_object($this->hidden)) {
					$this->hidden = new stdClass;
				}
$this->hidden->text = '';

Now that works and resolved all lines like that. Then I got this type of line with the same warning:

$this->dcol[ $number_of_columns ]->container_width = $this->content->width + $column_gutter - $round_amount;

I tried adding the if statement as above but got an error about an array not being stdClass. This is where my talents runs out and I don't know how to create the if statement to stop it warning about these lines. So, I commented the lines out and tested my site. It still works, as expected on every single page.

I suppose some people would call that a fix, but I am nervous that this will come back and bite me if i do something new or different on the site in the future, so ideally I want to fix it.

I'm on a shared 1&1 so can't get at php.ini to stop warnings showing, and I've tried varying ideas with custom php.ini files in sub folders and mods to .htaccess - all with no luck.

Any help on the sytax around the if statement for the array would be really helpful.

Thanks

David


kenyonhoagadmin on "Is it possible to extend the time it takes for the Twitter Widget to update?"

$
0
0

Hello,
I'm just curious if it is possible to extend the length of time for updating the Twitter Feed. For example, rather than having the feed pull in tweets for up to two hours back, can I make it pull tweets up to two days back? Is there a way to code this in the editor?

devrekli on "How to Add Meta Noindex to Feeds, RSS and Trackback?"

$
0
0

Hello. How to Add Meta Noindex to Feeds, RSS and Trackback? maybe we could do with functions.php? how?

thanks

mydavisfamily on "Help: Fatal Error - Using $this when not in object context"

$
0
0

Can anyone help out on this problem.
By substituting $thiss for $this I get rid of the error msg but then only the admin receives an email and none of the BCC: copies are sent out. Below is a snippet of the code. Any help will be appreciated.

===================================================
	Delivers email to recipients in plaintext
	*/
	function mail ($emails = array(), $subject = '$subject', $message = '$message ', $type='text') {
        global $comment, $post, $user, $subject, $message, $post_link, $blogname;

        if  (empty($emails)) { return; }
		// Set sender details
		if ('' == $this->myname) {
			$admin = get_userdata(1);
			$this->myname = $admin->display_name;
			$this->myemail = $admin->user_email;
		}
	    $headers = "MIME-Version: 1.0\n" .
			"From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" .
			"Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
		$headers .= "Return-Path: <" . $this->myemail . ">\n";
		$headers .= "Reply-To: " . $this->myemail . "\n";
		$headers .= "X-Mailer:PHP" . phpversion() . "\n";
		$headers .= "Precedence: list\nList-Id: " . get_settings('blogname') . "\n";
===================================================

enoquenroll on "Displaying list of cities according to the selected state. Using the WordPress h"

$
0
0

Hello,

I come to ask the community a help of a simple hook on WordPress. I'm trying to display a list of states and cities in two dropdows to select a single option in the a form. The list of cities will be displayed according to the selected state.

But the dropdown of list city is returning the source code of site. I do not know why this is happening, so I ask the help.

Here the code added in the Functions of theme:

<script type="text/javascript" src="http://prototypejs.org/assets/2008/9/29/prototype-1.6.0.3.js"></script>

        <select name="state" id="state" onchange="loadCity(this)">

        <option>-- Select the State --</option>

                <?php

global $wpdb;

//get the list of states
$list_of_state = ("SELECT DISTINCT meta_value FROM $wpdb->usermeta WHERE meta_key = 'state_acf_subscriber' ORDER BY meta_value ASC");

$option_of_state = mysql_query($list_of_state);

$total_of_state = mysql_num_rows($option_of_state);

                for($i = 0; $i < $total_of_state; $i++){

                        $state = mysql_fetch_array($option_of_state);

                            if($city[meta_value] != ''){

                                     echo "<option value=\"". $state['meta_value']."\">".$state['meta_value']."</option>";
                             }
                }?>

        </select>

<script type="text/javascript">
function loadCity(meta_value){

	if(meta_value){
		var myAjax = new Ajax.Updater('listCity','listcity.ajax.php',
		{
			method : 'get',
		});
	}
}
</script>

<div id="listCity"><label for="City">City: </label>

      	<select name="city" id="listOfCity">
      		<option value="">Select the City</option>
    	</select>
</div>

Here the another file:

<?php

global $wpdb;

$state_selected = $_GET['meta_value']; //get the state selected on the dropdown of states 

//below, get the list of city according the user's id what's are associated with state selected
$list_of_city = "SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = 'bairro_acf_aluno'
                 AND user_id IN (SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key = 'city_acf_subscriber' AND meta_value = '".$state_selected."') ORDER BY meta_value";

$option_of_city = mysql_query($list_of_city);

$total_of_city = mysql_num_rows($option_of_city);

for($j = 0; $j < $total_of_city; $j++){

	$city = mysql_fetch_array($option_of_city);

	echo "<option value=\"". $city['meta_value']."\">" . $city['meta_value'] ."</option>";

}

The list of states is correct, the dropdown appears showing all states added by subscribers. I just can not view the list of cities

Each user (subscriber) will select your state and city on your profile, and what I need is to be able to select the state and city to filter a list of users on the frontend.

I appreciate any help.

ikosweb on "How to separate data in wordpress metabox?"

$
0
0

just created a kind of long metabox using a tutorial at wptuts but I am lost in two things:

The output of the metabox displays all data grouped (ex. in grouped checkboxes they are all in a whole even if I have different groups) and I'd like to grab the titles of each group and display them in different tables, divs or blocks.

Don't know how to display the saved data in the post, and also display it in separate blocks.

My code is this:

$prefix = 'dbt_';
$meta_box = array(
'id' => 'features',
'title' => 'Property Features',
'page' => 'post',
'context' => 'normal',
'priority' => 'high',
'fields' => array(
    array(
        'name' => 'Price (in USD)',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

      array(
        'name' => 'Price (in Mexican Peso)',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

    array(
        'name' => 'Address',
        'desc' => '',
        'id' => $prefix . 'textarea',
        'type' => 'textarea',
        'std' => ''
    ),

    array(
        'name' => 'Property for',
        'id' => $prefix . 'select',
        'type' => 'select',
        'options' => array('Sale', 'Rent', 'Vacational Rental')
    ),

    array(
        'name' => 'Area (m2)',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

    array(
        'name' => 'Area of terrain (m2)',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

    array(
        'name' => 'Number of rooms',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

    array(
        'name' => 'Number of bathrooms. Include half bathrooms (ex. 2 1/2)',
        'desc' => '',
        'id' => $prefix . 'text',
        'type' => 'text',
        'std' => ' '
    ),

    array(
        'name' => 'Service Bathroom',
        'id' => $prefix . 'checkbox',
        'type' => 'checkbox'
),

array(
        'name' => 'Furnished',
        'id' => $prefix . 'checkbox',
        'type' => 'checkbox'
),
array(
        'label' => 'Property specs',
        'desc'  => '',
        'id'    => $prefix.'checkbox_group',
        'type'  => 'checkbox_group',
        'options' => array (
        'one' => array (
        'label' => 'Livingroom',
        'value' => 'one'
    ),
        'two' => array (
        'label' => 'Diningroom',
        'value' => 'two'
    ),
        'three' => array (
        'label' => 'Breackfast area',
        'value' => 'three'
    ), 

        'four' => array (
        'label' => 'TV room',
        'value' => 'four'
    ),

        'five' => array (
        'label' => 'Studio',
        'value' => 'five'
    ),

        'six' => array (
        'label' => 'Integrated Kitchen',
        'value' => 'six'
    ),

        'seven' => array (
        'label' => 'Laundry Room',
        'value' => 'seven'
    ),

        'eight' => array (
        'label' => 'Service room',
        'value' => 'eight'
    ),

        'nine' => array (
        'label' => 'jacuzzi',
        'value' => 'nine'
    ),

        'ten' => array (
        'label' => 'terrace',
        'value' => 'ten'
    ),

        'eleven' => array (
        'label' => 'balcony',
        'value' => 'eleven'
    ),

        'twelve' => array (
        'label' => 'Warehouse',
        'value' => 'twelve'
    )
)
),  

    array(
        'label' => 'Installed',
        'desc'  => '',
        'id'    => $prefix.'checkbox_group',
        'type'  => 'checkbox_group',
        'options' => array (
        'one' => array (
        'label' => 'Air conditioner',
        'value' => 'one'
    ),
        'two' => array (
        'label' => 'Stationary gas',
        'value' => 'two'
    ),
        'three' => array (
        'label' => 'Water heater',
        'value' => 'three'
    ), 

        'four' => array (
        'label' => 'Hurricain shutters or hurricain protection',
        'value' => 'four'
    ),

        'five' => array (
        'label' => 'Telephone line',
        'value' => 'five'
    )
)
),

    array(
        'label' => 'Outdoors',
        'desc'  => '',
        'id'    => $prefix.'checkbox_group',
        'type'  => 'checkbox_group',
        'options' => array (
        'one' => array (
        'label' => 'Parking space',
        'value' => 'one'
    ),
        'two' => array (
        'label' => 'Garden',
        'value' => 'two'
    ),
        'three' => array (
        'label' => 'Pool',
        'value' => 'three'
    ), 

        'four' => array (
        'label' => 'Tennis court',
        'value' => 'four'
    ),

        'five' => array (
        'label' => 'Children playground',
        'value' => 'five'
    )
)
),

    array(
        'label' => 'Facilities',
        'desc'  => '',
        'id'    => $prefix.'checkbox_group',
        'type'  => 'checkbox_group',
        'options' => array (
        'one' => array (
        'label' => 'Spa',
        'value' => 'one'
    ),
        'two' => array (
        'label' => 'Gym',
        'value' => 'two'
    ),
        'three' => array (
        'label' => 'Party salon',
        'value' => 'three'
    ), 

        'four' => array (
        'label' => 'Snack-bar',
        'value' => 'four'
    )

)
),

    array(
        'label' => 'Luxury Features',
        'desc'  => '',
        'id'    => $prefix.'checkbox_group',
        'type'  => 'checkbox_group',
        'options' => array (
        'one' => array (
        'label' => 'Clubhouse',
        'value' => 'one'
    ),
        'two' => array (
        'label' => 'Dock',
        'value' => 'two'
    ),
        'three' => array (
        'label' => 'Waterfront',
        'value' => 'three'
    ), 

        'four' => array (
        'label' => 'Golf course',
        'value' => 'four'
    )

)
)

)
);

add_action('admin_menu', 'mytheme_add_box');
// Add meta box
function mytheme_add_box() {
global $meta_box;
add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'],    $meta_box['context'], $meta_box['priority']);
}

// Callback function to show fields in meta box
function mytheme_show_box() {
global $meta_box, $post;
// Use nonce for verification
echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
echo '<div class="form-table">';
foreach ($meta_box['fields'] as $field) {
    // get current post meta data
    $meta = get_post_meta($post->ID, $field['id'], true);
    echo '<tr>',
            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
            '<td>';
    switch ($field['type']) {
        case 'text':
            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', '<br />', $field['desc'];
            break;
        case 'textarea':
            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', '<br />', $field['desc'];
            break;
        case 'select':
            echo '<select name="', $field['id'], '" id="', $field['id'], '">';
            foreach ($field['options'] as $option) {
                echo '<option ', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';
            }
            echo '</select>';
            break;
        case 'radio':
            foreach ($field['options'] as $option) {
                echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];
            }
            break;
        case 'checkbox':
            echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
            break;

// checkbox_group
case 'checkbox_group':
foreach ($field['options'] as $option) {
    echo '<input type="checkbox" value="'.$option['value'].'" name="'.$field['id'].'[]" id="'.$option['value'].'"',$meta && in_array($option['value'], $meta) ? ' checked="checked"' : '',' />
            <label for="'.$option['value'].'">'.$option['label'].'</label><br />';
}
echo '<span class="description">'.$field['desc'].'</span>';
break;    

    }
    echo     '</td><td>',
        '</td></tr>';
}
echo '</table>';
}

do_action('save_post', 'mytheme_save_data');
// Save data from meta box
function mytheme_save_data($post_id) {
global $meta_box;
// verify nonce
if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {
    return $post_id;
}
// check autosave
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    return $post_id;
}
// check permissions
if ('page' == $_POST['post_type']) {
    if (!current_user_can('edit_page', $post_id)) {
        return $post_id;
    }
} elseif (!current_user_can('edit_post', $post_id)) {
    return $post_id;
}
foreach ($meta_box['fields'] as $field) {
    $old = get_post_meta($post_id, $field['id'], true);
    $new = $_POST[$field['id']];
    if ($new && $new != $old) {
        update_post_meta($post_id, $field['id'], $new);
    } elseif ('' == $new && $old) {
        delete_post_meta($post_id, $field['id'], $old);
    }
}
}

// check autosave
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return $post_id;
}

tambourdeville on "Custom post type and permalinks"

$
0
0

Hi all!
I have an issue with my plugin:
I want to declare a custom post-type "flip_pong", in a class "flippong".
Untill here, everything is ok. The issue happens when I want to see a post of this CTP with pretty permalinks: 404 error !

I know I have to call flush_rewrite_rules() to rewrite the permalinks structure. So I call it at the plugin activation. Everything seems to work, except that I still have a 404 when I want to see a post.

If anyone have an idea about what I'm doing wrong..
Here's my code:

class flippong{
function create_flippong_post_types() {
	register_post_type( 'flip_pong',
		array(
			'labels' => array(
				'name' => __( 'Flipbooks' ),
				'singular_name' => __( 'Flipbook' ),
					'add_new' => __( 'add new' ),
					'add_new_item' => __( 'add a FlipBook' ),
					'edit' => __( 'edit' ),
					'edit_item' => __( 'edit FlipBook' ),
					'new_item' => __( 'new FlipBook;' ),
					'view' => __( 'see' ),
					'view_item' => __( 'see FlipBook' ),
					'search_items' => __( 'search FlipBook' ),
					'not_found' => __( 'no FlipBook found' ),
							),
			'public' => true,
			'taxonomies' => array('category'),
			'show_ui' => true,
			'publicly_queryable' => true,
			'rewrite' => array( 'slug' => 'flip_pong' ),
			'menu_icon' => plugins_url().'/flip-pong-v/images/book.png',
			'supports' => array('title','editor','thumbnail')
		)
	);
}

}//end class
add_action('init', array('flippong','create_flippong_post_types' ));
register_activation_hook( __FILE__, array('flippong','create_flippong_post_types' ) );
register_activation_hook( __FILE__, 'flush_rewrite_rules' );
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );

RichardLight on "Wordpress variables in enqueued javascript"

$
0
0

Hi,

I want to include a SIMILE timeline in my Wordpress plugin, so need to include the relevant javascript library files. These require some initial settings to be specified in javascript, which include the folder where the timeline library files are installed.

Because I am enqueuing the SIMILE library, I also need to enqueue a little javascript file which sets these variables. This means that I can't just do it in PHP, e.g.:

Timeline_ajax_url="<?php plugins_url('js/timeline_2.3.0/timeline_ajax/simile-ajax-api.js', __FILE__);?>";
Timeline_urlPrefix="<?php plugins_url('js/timeline_2.3.0/timeline_js/', __FILE__);?>";
Timeline_parameters='bundle=true&timeline-use-local-resources';

because by the time this code runs, it's too late. I have tried pretending that a PHP file containing code like the above is actually a javascript file, and enqueuing it, but unsurprisingly this doesn't work.

So, how do I specify the Wordpress plugins URL variable from within javascript?

Thanks,

Richard


enseense on "Category dropdown query_posts"

$
0
0

First of all i don't really know if it is the right forum to post in, if not please any one move to the right place, thanks.

I'm develeoping a dropdown menu that is filtering diferent categories from posts.
I'm currently using query_posts function like this:

query_posts( array('category__and'=>array($_GET['operation'],$_GET['type'])));

The get $_GET['operation'] and $_GET['type'] are passed obviously by get params from the form dropdown menu.

When I pass the 2 values throught the form the query runs correctly, it displays the posts within the correct categories selected, all good.

The trouble comes when at the form I'm not defining any one of the get values, so the get from the url is like empty.

Example:
operation=4
type=2

It Runs correctly.

Trouble:
operation=""
type=2

The query or whatever i can't see breaks and displays that there are no results.

Please help!

Luismin on "Add plugin to editor"

$
0
0

Hi.

I'm going to add a button to my WordPress Editor like a plugin. So, I need to know where is the init call to put some code in order to call to my plugin.

Something like this plugins : "simplelink" theme_advanced_buttons1 : simplelink"

I think It's in "class-wp-editor.php" but I do not where. Any help?

Thanks!

MatthewRuddy on "Remove new media modal entirely?"

$
0
0

Hi. Is it even possible to do this? I've been using Backbone extensively so I'm well used to it, and yet I can't figure out for the life of me how to completely remove a media modal (wp 3.5+).

The wp.media view contains lots of views, I get that, but simply calling 'remove' should remove the whole lot; the two <div>'s creating a modal creates, the frame itself another with the class '.browser' which I assume is for the file uploader functionality.

Instead, calling 'remove' just remove the inner frame (media-modal-content). Makes little sense to me, who would want to do that? 'close' closes everything, but doesn't destroy it.

I need to destroy as I'm using custom views within my own plugin which has an 'Insert Image' button. Clicking it creates a new media modal. Multiple media modal views in the DOM at one time are causing problems, so I need to make sure only one is within the DOM at a particular. Hence, upon clicking the modal 'X' I'm hacking the function to destroy the modal instead of just closing it (to be reopened if needed in the future).

Why is there no simple function for this? Or am I missing something..

Ottens on "Style post format on home only"

$
0
0

I'm trying to style the post format aside only on the front page of my blog. Specifically, I want it to give me a larger thumbnail there. Problem is, that also changes the way aside posts are displayed in tag and category archives -- which I don't want.

This is what I have in my content.php:

<?php
		if ( has_post_format('aside') ) {
		the_post_thumbnail('large');
		} else {
		the_post_thumbnail('medium');
		}
		?>

Adding either && is_front_page() or && is_home() to the first conditional statement, however, doesn't seem to make a difference. Am I doing something wrong?

hyoon01 on "Where are the tags/hooks such as "wp_nav_menu_args"?"

$
0
0

So as I was looking through the source code in nag-menu-template.php to change the hyperlinks of each page listing in the main menu, I came across:

$args = apply_filters( 'wp_nav_menu_args', $args );

However, I can't find where this hook/tag is defined in, despite searching this on wordpress and other sites. There are couple other tags/hooks:
wp_nav_menu_objects, wp_nav_menu_items.. Can someone tell me what file these functions/tags/hooks are located in? Do they just lack documentation, or am I not fully comprehending Plugins and hooks?

Viewing all 8245 articles
Browse latest View live




Latest Images