Jump to content

atmmultimedia

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

atmmultimedia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. // Get Custom Field Template Values function getCustomField($theField) { global $post; $block = get_post_meta($post->ID, $theField); if($block){ foreach($block as $blocks) { echo $blocks; } } } I am sorry, I don't understand the code, because I was learning from a tutorial.
  2. Hello there, I am struggling with a PHP function, I am modifying WordPress I am not a coder. But I've looked at tutorials. Here is my PHP code, I am trying to attach CSS to this line of code. When I try it in WordPress the system crashes and dies. This is my html: <div id="block-1" class="content-box"> <!--<h2>Block #1</h2>--> <div class="entry"> <?php getCustomField('Block #1'); ?> </div> </div> This is the function for the PHP: #----------------------------------------------------------------- # Field Templates #----------------------------------------------------------------- // Get Custom Field Template Values function getCustomField($theField) { global $post; $block = get_post_meta($post->ID, $theField); if($block){ foreach(($block) as $blocks) { echo $blocks; } } } The CSS for: <div id="block-1" class="content-box"> /* Disposable Styles */ *.content-box { /*text-align:center; padding:22px; */ margin-left:80px; margin-top:30px; background:#fff; width:768px; height:432px; margin-bottom:35px;float: left; border: 1px solid #D3D3D3; padding: 5px; background: #fff; } I would like that CSS to work the function. Because in WordPress my client wants to apply video in this box but not on every page. The current code is saying load the box up on every page. I am grateful for any help. Many thanks
  3. Hi I've tried that, And it appears not to do anything unless. I've placed the code in the wrong place. <?php if ( is_page('7') ) { echo '<style type="text/css">.breadcrumbs{display:none !important;} .headline{display:none !important;}'; } // the title if (strpos(get_the_title($post->ID), '//')) { $thisTitle = '<strong>' . str_replace('//', '</strong> // ', get_the_title($post->ID)); }else { $thisTitle = '<strong>'. get_the_title($post->ID) .'</strong>'; } ?> <!-- Title / Page Headline --> <div class="full-page"> <h1 class="headline"><?php echo $thisTitle; ?></h1> </div> <div class="hr"></div> <!-- Breadcrumbs --> <div class="full-page"> <p class="breadcrumbs"> <?php show_breadcrumbs(); ?> </p> </div>
  4. Hello everyone, Firstly, I want to say this is the best forum I've seen so far. I have a basic knowledge of PHP. I can get by with includes. I am modifying a WordPress website for a client. The client wants a video player displayed in the website, which is fine. There is an include there for the video player. WordPress is made up of several PHP files. In the header file: I've placed this code: <?php if ( is_page('7') ) { ?> <?php include('videoplayer.php'); ?> <?php } else { ?> <?php } ?> Which means on page 7 of the wordpress site displayed the content of the video player. In the video player.php file there is a title and breadcrumb. In the image attached you can see I have a duplicate title and brumbcrumb, the title and breadcrumb below the video player needs to be removed. I am curious how to apply an if statment to this. Here is the code I'll need to change to apply the if statement. Any help will be greatly appreictated. <?php // the title if (strpos(get_the_title($post->ID), '//')) { $thisTitle = '<strong>' . str_replace('//', '</strong> // ', get_the_title($post->ID)); }else { $thisTitle = '<strong>'. get_the_title($post->ID) .'</strong>'; } ?> <!-- Title / Page Headline --> <div class="full-page"> <h1 class="headline"><?php echo $thisTitle; ?></h1> </div> <div class="hr"></div> <!-- Breadcrumbs --> <div class="full-page"> <p class="breadcrumbs"> <?php show_breadcrumbs(); ?> </p> </div> <!-- End of Content --> <div class="clear"></div> What I am trying to do is to place if statement that if page is = 7 appears I'd like no post title and no breadcrumbs please. Many many thanks [attachment deleted by admin]
  5. Hi Everyone, My name is James, I am a full time web designer and blogging. I am good at HTML, CSS, SEO and other graphical design. I am here to learn more about PHP. I know bits and bobs. But I am here to learn more advanced PHP. Many thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.