Forum Replies Created

Viewing 15 replies - 31 through 45 (of 48 total)
  • Thread Starter khanate

    (@khanate)

    Man, this is making my head spin… Please help me out.

    HOW do I set the the custom field?

    Ughhh this is too complicated to just simply turn off a link!

    Thread Starter khanate

    (@khanate)

    Yeah, already tried removing some of the “}”, but still get errors on the third line.

    The first “{” seems to be wrong, as its highlighted in red..

    Or maybe its because I didn’t set the “coming soon” meta, yet?

    (Which I have no idea how to do, tbh)

    Thread Starter khanate

    (@khanate)

    Could you please elaborate how to create a custom post meta?

    Is it done thru Custom fields? Where should I put [what?] code?

    I looked up a few tutorials, but things get a little complicated for me, espcially when I don’t have custom fields in my portfolio post type…

    Thread Starter khanate

    (@khanate)

    thing is, for my portfolio post types, I can’t turn on Custom Fields [from the Screen Options]. Downed the Custom Field Template, but its making my head spin, can’t make out how to turn it on.

    Thread Starter khanate

    (@khanate)

    Hm, I get error on the third line of your code; in EditPad, the { brackets on first and third line of your code are displayed in red (which means they’re “un-inclosed, or something)

    Thread Starter khanate

    (@khanate)

    Well the idea is simple; I’ve got a grid of portfolio items/thumbnail images and at the backend I can determine if they’re gonna open in full post (permalink) or if they just open in a lightbox image; (the backend is carried in the meta-boxes.php)

    I’d like to add another option for ‘in progress’ works, where the thumbnail won’t be clickable at all, so it would just show an alt text, like ‘Coming soon…’.

    basically what I need to do is add another line like this:

    $featured_image_link_to_options = array(
    	  			'post' => __('Full Post','cudazi'),
    	  			'image' => __('Image','cudazi')
    	  			'coming-soon' => __('Coming Soon','cudazi')

    and somehow tell that ‘coming-soon’ won’t have any a href (the get permalink is obviously not good)

    else if ( $featured_image_link_to == 'coming-soon' ) {
    					$featured_image_link = get_permalink();
    				}

    but I don’t know how to assign it with another has_post_thumbnail like this:

    if ( has_post_thumbnail() ) {
    			return "<div class='post-thumbnail'>" . $featured_image . "</div>";
    		}

    (man, this support forum needs a better way of showing code, needs some color differentiation, or at least the iframe should be scalable!)

    Thread Starter khanate

    (@khanate)

    Oh, sorry for the bump, didn’t realise its that much of a no-no.

    So that div is located in my functions.php, the a href is at the very end

    // Get Featured Image + Link
    	function cudazi_get_featured_image( $img_size, $fallback ) {
    		global $post;		
    
    		$cudazi_post_hide_featured_single = get_post_meta($post->ID, 'cudazi_post_hide_featured_single', true);
    		if ( is_single() && $cudazi_post_hide_featured_single ) {
    			return false;
    		}
    
    		if ( has_post_thumbnail() ) {
    			$featured_image_link_to = get_post_meta($post->ID, 'featured_image_link_to', true);
    			$featured_image_link_to_url = get_post_meta($post->ID, 'featured_image_link_to_url', true);
    			if ( $featured_image_link_to_url ) {
    				$featured_image_link = $featured_image_link_to_url;
    			}else{
    				if ( $featured_image_link_to == 'post' ) {
    					$featured_image_link = get_permalink();
    				}else if ( $featured_image_link_to == 'image' || !$featured_image_link_to ) {
    					$featured_image_link = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
    					$featured_image_link = $featured_image_link[0];
    				}
    			} // end if url set
    			$featured_image = get_the_post_thumbnail($post->ID, $img_size, array( 'class' => '' ));
    		}else{ // no thumbnail set
    			$featured_image_link = get_permalink();
    			$featured_image = $fallback;
    		} // end if has featured image				
    
    		if ( has_post_thumbnail() ) {
    			return "<div class='post-thumbnail'><a href='" . $featured_image_link . "'>" . $featured_image . "</a></div>";
    		}
    	}

    Deleted the a href from there, and the image lost the link, which is nice, but how will I determine/assign which images will have it and which won’t, now that is going to be quite a task.

    Btw, here’s the theme I’m using.

    Thread Starter khanate

    (@khanate)

    Thanks for the reply, but no, that didn’t removed the link, it links to the home/index page now…

    here’s the web https://www.zemaraim.com/page/2/ (the bottom row has the ‘post’ setting.)

    [No bumping, thank you.]

    Hey man, so have you finally made this work?

    I have found that “featured_image_link_to” is found in the meta-boxes.php and functions.php (in my theme obviously).

    But I have no knowledge of PHP so don’t have a clue how to replace that get_permalink() with something that would actually disable the whole ‘a href’ thing…

    Thread Starter khanate

    (@khanate)

    So, this actually says what to do with the link

    if ( $featured_image_link_to == 'post' ) {
    					$featured_image_link = get_permalink();

    What should I write instead of get_permalink, to disable the link?
    Or maybe, how do I add a CSS class in there (to hide it or something)

    Pretty please help me out

    Thread Starter khanate

    (@khanate)

    YO!

    Pretty please?

    Thread Starter khanate

    (@khanate)

    oh and here’s the portfolio

    https://www.zemaraim.com/

    Thread Starter khanate

    (@khanate)

    Oh I have found the solution, sometimes it helps to ask someone else to change the way you think, even if you don’t get an answer! haha

    how do you delete topics in here???

    Thread Starter khanate

    (@khanate)

    woah im a moron, thanks! ??

    Well I wish someone would explain how the slider on this theme as I think it rules….

    https://www.dizenoco.com/demo/

Viewing 15 replies - 31 through 45 (of 48 total)