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

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-


YST on "Display Posts in a tabbed array"

$
0
0

Hi,

I am trying to build 'team' page where the goal is to display the photo of the person and a bio about them. I was told to create a post for each person in a category called 'team' and use an array to display the pictures in a carousel and when you click the persons picture it would display the bio at the bottom.

I don't know where to start with this apart from creating a category, featured image for each post is the persons picture and the content is their bio.

Any help would be much appreciated..

Category name: team
Display via tabbed/carousel array on different page.

Thanks

revxx14 on "Great, free idea for a mega menu plugin. Someone please make it happen."

$
0
0

After hours and hours of fighting with nav walkers, I thought there needed to be a better way for web developers to create mega menus. After thinking about it a bit, I've come up with this:

  • Wrap second level <ul>s in <section>
  • Add class mega menu and mega-menu-columns-# to parent <li>s that contain mega menus
  • Add "Menu Structure" options to Menu editor
    • New Column: Can only be placed within the second level <ul>. Adds </ul><ul> where a menu item would normally appear. If placed at the beginning or end of a <ul>, it does nothing.
    • Widget: Allows the user to pick a widget to display. Also acts as a column break, as it's a <section> wrapped in </ul><ul>. If placed at the beginning of a <ul>, does not include leading </ul>. If placed at the end of a <ul>, does not include trailing <ul>. Can only be placed within the second level <ul>.
  • Menu structure appears as below:
<ul>
	<li id="menu-item-1" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1 mega-menu mega-menu-columns-2">
		<a href="http://www.example.com/about/">
			About Us
		</a>
		<section>
			<ul class="sub-menu">
				<li id="menu-item-2" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2">
					<a href="http://www.example.com/about/company-profile/">
						Company Profile
					</a>
				</li>
				<li id="menu-item-3" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3">
					<a href="http://www.example.com/about/leadership-team/">
						Leadership Team
					</a>
				</li>
				<li id="menu-item-4" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-4">
					<a href="http://www.example.com/about/professional-affiliations/">
						Professional Affiliations
					</a>
				</li>
			</ul>
			<ul>
				<li id="menu-item-5" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5">
					<a href="http://www.example.com/about/clients/">
						Clients
					</a>
				</li>
				<li id="menu-item-6" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6">
					<a href="http://www.example.com/about/partnerships/">
						Partnerships
					</a>
				</li>
			</ul>
		</section>
	</li>
	<li id="menu-item-7" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-7 mega-menu mega-menu-columns-3">
		<a href="http://www.example.com/services/">
			Services
		</a>
		<section>
			<ul class="sub-menu">
				<li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8">
					<a href="http://www.example.com/services/civil-engineering/">
						Civil Engineering
					</a>
				</li>
				<li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9">
					<a href="http://www.example.com/services/land-planning/">
						Land Planning
					</a>
				</li>
				<li id="menu-item-10" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10">
					<a href="http://www.example.com/services/surveying/">
						Surveying
					</a>
				</li>
			</ul>
			<ul class="sub-menu">
				<li id="menu-item-11" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-11">
					<a href="http://www.example.com/services/information-technology/">
						Information Technology
					</a>
				</li>
				<li id="menu-item-12" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12">
					<a href="http://www.example.com/services/subsurface-utility-engineering/">
						Subsurface Utility Engineering
					</a>
				</li>
			</ul>
			<aside>
				<h6>Widget Title</h6>
				<p>Maecenas quis semper arcu. Quisque consequat risus nisi. Sed venenatis urna porta eros malesuada euismod. Nulla sollicitudin fringilla posuere. Nulla et tellus eu nisi sodales convallis non vel tellus.</p>
			</aside>
		</section>
	</li>
	<li id="menu-item-13" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13">
		<a href="http://www.example.com/projects/">
			Projects
		</a>
	</li>
	<li id="menu-item-14" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-14">
		<a href="http://www.example.com/news/">
			News
		</a>
		</li>
	<li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15">
		<a href="http://www.example.com/contact/">
			Contact Us
		</a>
	</li>
</ul>

Rich Owings on "Changing the modified time but moving to most recent position"

$
0
0

Hi all,

I need to update posts on my site to a new category once the status has changed, say from coming soon to now playing. When this happens I want the post to move to the top of the blog, showing as the most recent post.

There are a few different ways to do this, but they each seem to be presenting problems:

1. I have added code in functions.php to show the modified date if a post has been updated. But it doesn’t move it to the top of the blog as the most recent post. To do this I still have to change the publish date. A sticky post plugin won’t help because it should move down one place once the next post goes up.

Note that if I change the publish date it changes the month/date in the URL.

2. I can change to a different permalink structure but when I change the date I’ll be confusing Google with a modified publication date for the same post.

3. I could create a new post and 301 redirect the old one to it, but then I end up with a bunch of 301’s.

Any ideas?

lilts520 on "Displaying all posts on homepage"

$
0
0

I recently updated to wordpress 3.9.1 and something happened where rather then loading all thumbnails of posts on the homepage, I now see an "older"/"newer" links navigation on the bottom.

How can I revert back to loading all posts on the homepage? I tried to deactivate all plugins, so there is nothing interfering there. I also found the reference for the older/newer links on the front.php page. Is there a command I can type in there that would force display all posts?

Any help would be appreciated! Thanks!
website

GuerrillaCode on "Trouble with add_menu_page function"

$
0
0

Hello. I am having an issue with add_menu_page(). My Page output is not showing, where it should be I am getting an error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /home/content/45/8909445/html/clients/ereading/wp-includes/plugin.php on line 470

I know add_action() uses PHP's native call_user_func_array() so I guess that might have something to do with it. Below is my code for creating the menu page and the page output function (Currently I just wanted to echo some text):

public static function register_wpidSwiper_menu_page() {
            add_menu_page('iDangerous Swiper Slides', 'Homepage Slides', 'manage_options',
                    'wp_idangerous_swiper', array( $this, 'admin_page_output'),
                        plugins_url( 'wp-idangerous-swiper/img/swiper-icon.png' ));
        }

        public function admin_page_output() {
            //Create markup for admin page
            echo "Hello iDangerous Swiper";
        }

I am calling this in my classes constructor:

public function __construct() {
            add_action( 'admin_menu', array( $this, 'register_wpidSwiper_menu_page' ) );
        }

My menu item appears in the side menu, with my custom icon, but when I click to go to the page the page displays the error I mentioned above instead of the string I echo in my admin_page_output() method.

Anyone know where this is going wrong for me?

Thanks!
Isaac

hawkeye126 on "WP-CLI Network Site Meta Format Question"

$
0
0

I accidentally deleted all my super users on my wp multisite.
I did this by trying to add a new super user via the command line with the following wp-cli command:

wp network meta update 1 site_admins exampleuser

This overwrote the entire entry and set it only to "exampleuser". I believe I did not pass the value, exampleuser, correctly. Previously when I ran

wp network meta get 1 site_admins

The return value was in this format:

array (
  0 => 'username1',
  0 => 'username2',
)

I feel I can fix this problem if I know how to format the entry correctly

wp network meta update 1 site_admins exampleuser

What do I need to use for the --format parameter?
How to I enter the site admin into the site_admin network meta table?

roylitwin on "Certification Salary Survey Results 200-120"

$
0
0

Well way well hymen it so much time equipment today can you introduce yourself and tell me little bit about yourself lade hey amber am I am at you mama bad NY but one for sixteen years almost sheet and about eight years I L LA $ payments and already course have about min toast night that parents and then a crash it we get pregnant again with number four and actor him I lost an additional panels its which me at a hundred in batch and after I am praying it after and his birds and my mentor who site with me entire process which and with her 200-120 was probably more about sheave a thirty minute or so am really encouraged me to get certified each group fitness and Rafael okay cool a after having some away okay the Batman up like I'm not ready to deal with it yeah anyway long story short I teaching the ladies man an arm eventually add became she and send it back to me at a personal trainer and I also have miss in health and wellness she and then action that we had an additional child so we have packets its I it’s at this is my doing it’s my passion teens well really being used to help and other individuals net specifically women though.
For more information, visit our site >>>>>>> http://200-120ccnaexam.com/


tongny on "Suspension Mitigation Case"

$
0
0

Dear everyone,

I am getting trouble with my hosting provider on "Suspension Mitigation Case", and they moved my hosting to another hosting.
Here is my website: http://huggaz.com , built with wordpress 3.5.1 + woo-commerce plugin, and it was block few day ago.

If I am not wrong, this hosting is crazy.

Any suggestion is appreciated.

Thanks,
Tongny

afton.wilky@gmail.com on "Conditional statements calling custom metadata help"

$
0
0

Hi all,
Hoping you can help. I've built a book-catalog plugin which uses custom metadata fields. Right now I'm building the template that displays the custom metadata and my conditional statements always return true, even if they are empty. (My html tags are echoing even though the custom field is empty)

<?php
	if ( get_post_meta( $post->ID, 'book-excerpt' ) != null ); {
		echo '<div id="book-excerpt">';
		echo '<h6>Excerpt from <em>'; echo get_post_meta($post->ID, 'book-title', true); echo '</em></h6>';
		echo get_post_meta($post->ID, 'book-excerpt', true);
		echo '</div>';
	}

	if ( get_post_meta( $post->ID, 'book-blurb-1' ) != null ); {
		echo '<div id="blurbs">';
		echo '<h6>What’s being said about <em>';
		echo get_post_meta($post->ID, 'book-title', true);
		echo '</em></h6>';
		echo '<div class="blurb">';
		echo get_post_meta($post->ID, 'book-blurb-1', true);
		echo '</div>';
	}

	if ( get_post_meta( $post->ID, 'book-blurb-2' ) != null ); {
		echo '<div class="blurb">';
		echo get_post_meta($post->ID, 'book-blurb-2', true);
		echo '</div>';
	}

	if ( get_post_meta( $post->ID, 'book-blurb-3' ) != null); {
		echo '<div class="blurb">';
		echo get_post_meta($post->ID, 'book-blurb-3', true);
		echo '</div>';
	}
	if ( get_post_meta( $post->ID, 'book-blurb-1' ) != null); {

		echo '</div>'; // closes the div links-extras without needing all three blurbs
	}
	if ( get_post_meta( $post->ID, 'author-photo-bio' ) != null); {
		echo '<div id="author-photo-bio">';
		echo '<h6>About the Author</h6>';
		echo get_post_meta($post->ID, 'author-photo-bio', true);
		echo '</div>';
	}

?>

shediv on "wp_mail and @wp_mail difference"

$
0
0

Hi,

I am new to WordPress development
I was trying to send attachment with wp_mail but what i noticed is that when i try
wp_mail($to, $subject, $message, $headers,$mail_attachment);

mail goes but without attachment

And when i do
@wp_mail($to, $subject, $message, $headers,$mail_attachment);

attachment goes...

Any one can tell me why so..???

yingkhun on "help me about thumbnail"

$
0
0

index.php

$thumbID = get_the_post_thumbnail( $post->ID, 'background', $imgsrcparam ); ?>
<div class="preview"><a><?php echo "$thumbID"; ?></a></div>

function.php

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 305, 9999 );
add_image_size( 'background', 305, 9999 );

i need to use original image(url) and resize to 305,xxx
but this code make thumbnail size and low quality.

ex.
original url :
http://www.test.com/img.jpg

this code make :
http://www.test.com/img-305x252.jpg

i want to use original url and resize to 305x252 (it's make high img quality)
how to edit this code

ps.sorry about bad in english and thanks

alejom84 on "Insert custom sidebar if is_frontpage"

$
0
0

Hello everybody, I created a custom sidebar in functions.php and inserted the following piece of code to display it next to the frontpage slider:

<div style="position: absolute;right: 260px;z-index: 4;">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar-Demo') ) : ?>
<?php endif; ?>
</div>

So far so good, it is displaying correctly, the problem I'm having is that it's also displaying in all the pages. I'm trying this:

<?php if ( is_frontpage() ) {
	if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar-Demo') ) {
		echo '<div style="position: absolute;right: 260px;z-index: 4">';
			dynamic_sidebar();
		echo '</div>';
	}
} ?>

And many other variations but I can't get it to work, any help will be greatly appreciated. Thanks in advance.

macgamer on "new mce-view api"

titine14 on "Assign category with autopost"

$
0
0

Hello,

I search a solution to a recent problem, I made a plugin to automatically create a post when I upload an image on the media uplaoder (to create quickly many posts with images).

That's work well but now I try to assign them in categories, I don't want to have to do this by manual.

So I look for a solution to define the category with the upload, like maybe put all the images in a folder with the category name.

But I can't find a way to retreive the folder name.

Any solution? Ideas?

Thanks,

Etienne


Pete on "CPT slug crashing my template because it has the word 'for' in it?"

$
0
0

I have this piece of code, it's works great. I use it with CPTs as seen below 'post_type' => mortgage-home-loan. I'm trying to use it on another website which is more or less identical but with a different CPT slug property-for-sale but for some reason the code crashes my page. If I paste in the original mortgage-home-loan slug then it doesn't crash!

In my notepad++ something weird happens... the for part of property-for-sale is in a different colour (try it yourself). Which makes me think the for part of the slug is causing the crash... is this a WP bug or my fault?

original code... no problem

<?php
			if ( is_single()) {
			$categories = get_the_category();
			if ($categories) {
			foreach ($categories as $category) {
			$cat = $category->cat_ID;
			$args=array(
			'cat' => $cat,
			'order' => asc,
			'post_type' => mortgage-home-loan,
			//'orderby' => rand,
			'post__not_in' => array($post->ID),
			'posts_per_page'=>9999,
			'caller_get_posts'=>1
			);
			$my_query = null;
			$my_query = new WP_Query($args);
			if( $my_query->have_posts() ) {
			// echo '<p>Check out our other '. $category->cat_name . ' products</p>';
			while ($my_query->have_posts()) : $my_query->the_post(); ?>

<?php the_title(); ?>			

			 <?php
			endwhile;
			}}} wp_reset_query(); }
			?>

New code... crashes the page

<?php
			if ( is_single()) {
			$categories = get_the_category();
			if ($categories) {
			foreach ($categories as $category) {
			$cat = $category->cat_ID;
			$args=array(
			'cat' => $cat,
			'order' => asc,
			'post_type' => property-for-sale,
			//'orderby' => rand,
			'post__not_in' => array($post->ID),
			'posts_per_page'=>9999,
			'caller_get_posts'=>1
			);
			$my_query = null;
			$my_query = new WP_Query($args);
			if( $my_query->have_posts() ) {
			// echo '<p>Check out our other '. $category->cat_name . ' products</p>';
			while ($my_query->have_posts()) : $my_query->the_post(); ?>

<?php the_title(); ?>			

			 <?php
			endwhile;
			}}} wp_reset_query(); }
			?>

saurabhsjain91 on "Adding images in folder on page"

$
0
0

Hi everyone. I'm having a site running on wordpress 3.9.1. My question is i am having a page with many images in it, i want to display half images into 1 folder(folder in page itself) and other half images in other folder, is it possible to do that. Thanks in advance

Zishan J. on "TinyMCE Add Media drag and drop"

$
0
0

I am in the process of developing new plugin. In this plugin I am using
Tinymce editor in custom page in wp admin "Settings" area. I am able to
load it using wp_editor() with drag_drop_upload and media_buttons enabled.
It loaded well. But the problem is when I click the "Add Media" button, it
shows a popup screen but I can't drag and drop files to upload in it. This
feature works well in PAGES and POSTS area. Is there any workaround to
this?

raf2205 on "access my footer using javascript in a .php file"

$
0
0

Hi,
I am trying to access my footer using javascript in a .php file.
but the footer var is always null.
any help?

<script type="text/javascript">
  var _document = jQuery(document);
  var footer = document.getElementById("colophon");
  console.log("footer: " + footer);

  //footer.style.marginRight = 100 + 'px';

</script>

roonie.nova on "WordPress admin panel is LOCKED"

$
0
0

Hello Support,
I am unable to login into my WordPress Website Admin panel.. It shows me nothing but a message

"LockeD By MED
pass plz:"

Please help me to get rid out of this..
Thanks in advance!!

Regards
Roonie

Viewing all 8245 articles
Browse latest View live




Latest Images